CDS028
File Maintenance |
Last Revised: 02/02/15 |
This program can be run or called to provide file maintenance for files described in the Data Dictionary. File Maintenance applications provide the ability for users to add, modify, delete, and view records from data files. Each File Maintenance includes at least one Standard View, but frequently also includes additional Views. The data file must be defined using Data Dictionary Maintenance (FMS). The Views must be defined using the Views Option of Data Dictionary Maintenance (FMS). The Views to be included in the File Maintenance are specified in the File Maintenance Option of Data Dictionary Maintenance (FMS). CDS028 can also be used in 'inquiry only mode' where records can be displayed but not modified, added, nor deleted. Inquiry only mode is also enabled when the user does not have write permissions to the primary data file.
CDS028 is typically RUN from the menu; however, applications can also RUN or CALL CDS028 as needed.
When CDS028 is run, the following variables are used. All other variables are cleared. The Data Dictionary company code and Data Dictionary File Name are derived from Y.APPID$
. Y.VDTSFX$
is used for the File Maintenance VDT Suffix. When the user exits, the Dynamo menu CDS001 will be run.
CDS028 is also run from the Dynamo menu when the menu selection type is set to "F" for File Maintenance. In most cases, the data file to be maintained can be determined by the Application ID. When the data file name does not match the data dictionary file name, you can specify the data file name as File 1 in Menu Maintenance.
Effective with CDS028 dated 02/24/14 or later, if the record has changed, it will be written to disc on multiple-view maintenance whenever the user selects a view option. This ensures that any routine that reads the record from disc will always have the latest version of the record.
Y$
|
Session Control Variable. Optional.
|
||||||||||||
FILENAME$
|
The data file name to be maintained, including a company code if applicable. Required. May begin with XX indicating the current company code. |
The following variables are used when CDS028 is called.
CALL "CDS028", Y$, S028$ {, RECMAIN$ }
Y$
|
Session Control Variable. Optional. | ||||||||||||||||
S028$
|
|
||||||||||||||||
RECMAIN$
|
The templated string can be used to pass key segments of a specific record to be maintained to CDS028 eliminating the need for the operator to enter any key segments. It is also used with Subsidiary File Maintenance where The key segments in the subsidiary file will be derived from |
In most cases, the operator enters the various key segments that make up the key to the primary data file being maintained. CDS028 will provide default values and allow use of the ArrowUp and Down keys to step forward and backward through the file.
When multiple records already exist in the file, the user will also be presented with the option to 'Select existing record from list'. This option will call CDS037 to display the fields specified using File Maintenance Configuration (FMS). Search capabilities also exist to allow the user to select a record based on an entered search argument.
If the primary key to the data file only has a single value, then the key entry routines are not required. This is useful when creating File Maintenance for single records in control or parameter files.
RUN Example |
0180 IF OPT=2 THEN LET Y.APPID$="XXDD00",Y.VDTSFX$="A",FILENAME$=""; RUN "CDS028"
|
CALL Example |
4225 CALL "CDS041","CDS028",S028$,"YY"
|
Company Information Maintenance (SMC) is an example of File
Maintenance with a single view. This example also does not have a 'key' field that is entered by the operator. The Key field is specified in the data dictionary with a single value of "DD". When there is only one choice for the valid value of a key field, the value is assumed and not entered by the operator. Note that field 3 is a T type external called routine that is used for the entry of the Zip Code, City, and State. Field 9 is also a T type external called routine used for the entry of prefix segments. |
Location & Device Maintenance (SMC) is an example of File
Maintenance with two views. The first view is a Standard View that simply allows the user to maintain fields within the primary data file. |
Upon exiting the primary view, the user is presented with a list of views that they are authorized to select. |
In this case, the first view 'Locations' is the primary view already accessed. The Devices View is a called program view, which allows the software developer to link any custom programming required to the File Maintenance application. In this example, the CDS352 Dynamo Tool was used to maintain an unordered list of devices. |
If the user selects a device and touches enter, the user can maintain any of the device properties. This is done using CDS550. |
Item Maintenance is an example of File Maintenance with several
views. The primary view is shown below. |
The list of views is displayed when exiting the primary view. Each view can be a: a) standard view which allows the user to
maintain fields specified in the view using View Maintenance (FML),
or |
The Alternate Item Maintenance is an example of a standard view, although custom code was provided with a T type external routine for the Alternate Item#. |
Vendor Part Numbers is a Called Program view, as the application designer preferred to display multiple vendor part numbers on the screen at the same time. This data is also stored in a subsidiary file. A subsidiary file maintenance view could also be used, with the limitation of only displaying one record on the display at a time. |
Vendor Pricing is an example of a Subsidiary File Maintenance view. In this case the Vendor Prices are stored in a separate file which includes the ITEMNO in the key. The ITEMNO is the primary key to the Item file being maintained. The Pricing Start Date and Promo Pricing End Date are also key segments of the Vendor Pricing (subsidiary) file. Note the user did not need to re-enter the item# when maintaining the subsidiary file, as it was derived from the primary record. The user has the same options to enter key segments, select existing record from list, and search the subsidiary file as they have with the primary file. |
Example calling CDS028 passing key segments using RECMAIN$ |
2000 BEGIN
2010 CALL "CDS091",Y$
2020 DIM RECMAIN$:"CUSTNO:C(6)"
2030 LET RECMAIN.CUSTNO$=" 100"
2040 CALL "CDS041","CDS028",S028$,"YY"
2050 LET S028.DDFN$="CM01",S028.VDT$="A",S028.TOPROW=2
2060 CALL "CDS028",Y$,S028$,RECMAIN$
|