File Management Software
Data Dictionary Maintenance - File Maintenance |
Last Revised: 02/25/14 |
This option is used to identify the views that comprise a file maintenance application.
File Maintenance applications provide the ability to add, change, and delete records from a file.
File Maintenance applications are an automatic by-product of the Dynamo Data Dictionary. Before using the File Maintenance Option, define fields, key structure, and at least one standard view. File Maintenance supports file types DIR, SKx, and MKx.
If the Data Dictionary File Name is 4 characters or less, then you can link a File Maintenance application directly to the menu by using Menu Maintenance (SMU) and specifying a selection type of F, the Program/File as the company code (typically XX) followed by the Data Dictionary File Name, and the VDT Suffix to match that specified in File Maintenance Configuration, typically A. If the Data Dictionary File Name is more than 4 characters, you cannot currently attach it directly to the menu, but can write a very short program with a program name of 6 characters or less, which will invoke File Maintenance. See example below.
File Name | The file name as previously defined in the data dictionary | ||||||||||||||||||
VDT | The VDT Suffix is used to enable multiple File Maintenance Configurations for the same data file. In most cases, only a single File Maintenance Configuration is needed per file, and the VDT is specified as A. Note the VDT must be specified in Menu Maintenance when connecting a File Maintenance application to the Dynamo menu. | ||||||||||||||||||
KNUM | File Maintenance applications typically use the primary key (KNUM 0) and the operator enters the segments of the key for KNUM 0. But there are some situations where an alternate KNUM is preferred. Using a KNUM other than 0 requires that the key be unique. | ||||||||||||||||||
Allow Record Adds | Normally Y, but can be set to N when operators should not be able to add new records to the file. | ||||||||||||||||||
Allow Record Deletes | Specify as N to prevent operators from deleting records from the file. | ||||||||||||||||||
Delete Files |
File Maintenance can prevent deletion of a record when there are records in another file with the same primary key as the file being maintained. File Maintenance can also remove records from related files that have a key whose starting characters match the key of the record being maintained. In the example below, File Maintenance will dis-allow deleting of the record, if there are existing records in the IM01, AP12, or AP22 files with a KNUM 2, or in AP32 file with KNUM 1, that starts with the same characters of the key for the record to be deleted. However, if there are no records in IM01, AP12, and AP22 that match, File Maintenance will delete the record being maintained, as well as all records in files VM03 and VM06 that have KNUM 0 keys that start with the same characters as the primary key of the record being maintained.
|
||||||||||||||||||
Display Fields |
When operators run a File Maintenance application, they can either enter the key segments to uniquely identify a record or select an existing record from a list. The fields that are displayed in this list are specified here. In this example, 10 fields will be displayed. They happen to be all from the same file, although they can be from related files or programs that return a templated data structure. Refer to CDS037 for additional details. The Index column is only used when the Field is a repeating field. The first screen shot below shows the Display Fields as specified in File Maintenance Configuration. The second screen shot shows the display in the File Maintenance application.
|
||||||||||||||||||
Add/Write/Delete Routine |
This optional program name will be called to perform additional
processing required. The
|
||||||||||||||||||
Views | File Maintenance applications require the first view to be a Standard View. These views must be previously defined using
the Views Option of Data Dictionary Maintenance (FMS). File Maintenance may however, include additional views. Additional Standard Views of the same file would be needed when there are more fields to be maintained than can be displayed in a single view. A Standard View can display up to 21 rows of data including key segments in a single column on a typical display with 25 rows. Group the fields that are related into another view when exceeding this limitation. The initial view will be displayed and maintained during File Maintenance. When the operator exits the initial view, they will be presented with a list of all views for this File Maintenance Configuration in the same sequence as specified.
|
Record Deletion
File Maintenance performs the following steps before deleting a record:
- Checks each 'Delete File' set to 'Do not delete'. If there are any records in these files where the key starts with the same characters as the primary key being deleted, then the delete will not be allowed. In the example above, files XXIM01, XXAP12, XXAP22 and XXAP32 will be checked.
- Calls the Add/Write/Delete program if specified. If this program exits with EXIT 99, then the record will not be deleted.
- Deletes any records from the related 'Delete Files' that are set to 'Delete records'. In the example above, any records in files XXVM03 and XXVM06 will be removed where the starting characters of the key match the key of the record being deleted.
- Deletes the record in the file being maintained.
Example of interfacing a File Maintenance application to the
Dynamo Menu. Note the Type should be "F", the Program/File Name should be the company code and 4 character File Name, and the VDT suffix should match that entered using File Maintenance Configuration. |
If the Data Dictionary File Name is longer than 4 characters, then the following program can be used to call the File Maintenance Application. In this example, the company code used will be the active company (XX), the Data Dictionary File Name is CUSTOMERS, the VDT Suffix is A, and the data file name is "CUSTOMERS". |
0100 REM "CUSTFM - Example of calling a File Maintenance
Application
|
Example of an Add/Write/Delete Routine to display information when called |
0100 REM "CDX110 - 05/18/07 Example of File Maintenance
Add/Write/Delete Routine
|
Example of an Add/Write/Delete routine used in View Maintenance |
0100 REM "CDF173 - 05/17/07 View Maintenance -
Add/Write/Delete Routine
|