File Maintenance

> This is one of the options that provide powerful features for file manipulation. Facilities provided are Sorting of records, merging of records, validating the records and Exporting to xBase or another COBOL file format. The File Maintenance option has following sub-options:

> > - Sort
> > - Merge
> > - Validate
> > - Export
> > - Calculate

Each one of above mentioned sub-option is described below:

1. Sort

> This option can be invoked either internally through the program or externally under DOS prompt. When this option is invoked the file menu is displayed. At this point, user has to key-in the required .ADF file name. The program gets into sort menu, if that file is found. The Input file name along with extension of .ADF is displayed. User has to key-in the required Output file name. The sorting can be performed in two different ways.

> Sort on Indexes defined under the format file: When this is chosen the program refers to index fields defined under the format file. If there is a single unique index key defined, it will be taken as the first (primary) key. If there are more than one key, it will be in the order of key fields. Here the sorting order is always ascending.

> Sort in order of sort field specified: Under this option user can choose the fields to sort and also its Order. When this is Invoked a menu is displayed prompting the user to enter the required information.

#### Sort selection Menu

The field name, field type and field length are taken from the '.FMT' file and displayed as it is. The Order and sequence has to be filled by the user. Order can be any number from 1 to 999. The sequence can be either "A" or "D". "A" indicates Ascending Order and "D" indicates Descending order. Default order is Ascending order. The program groups the sort keys in its order and sorts them. After sorting, it displays the status of the sort in the following manner:

Sorting Complete- Status : Success … In the case of success.
Sorting Complete - Status: Cannot Sort … In the case of failure

2. Merge

   This option helps the user to merge several files of the same format and produces a single resultant file. Three types for merge options are provided. The type of options available are displayed below:

   Mergetype
   Plain Merge
   Merge through format File
   Merge through Data File

   > 1. Plain Merge:
   > This is exactly similar to that of standard copy A+B option of DOS except that it checks of the length of the record during the copy process.
   > 2. Merge through Format File:
   > This checks for format file, if it exists. If the format file is found along with data file, it goes ahead and gets the next file. Fields of each file are compared in this process. Maximum of five files can be merged at a time.
   > 3. Merge Thorough Data File:
   > This is exactly similar to that of format file except that entire records are compared.

3. Export

   This option provides a facility for exporting the data to a xBase (viz. Clipper, dBase and FoxPro) and also reformatting of created file(s). When this option is invoked, first it checks for the format file. Later the following list-box is displayed to select the type of export.

   After selecting the required type of file, it asks for output file name. Since no checks are performed during export, user should validate data first before export.

   ##### Export Conversions for DBF files:

   The following types of conversion takes place while exporting to DBF files:

   OdEan Files | DBF Files
   --- | ---
   Field Type | Field Type
   A - Alpha | C - Character |
   G - Alphanumeric | C - Character
   D - Date | D - Date
   N - Number | N - Number

   During convertion, it takes care of every type of date storage format. While converting number, it allows the sign field conversion appropriately. The DBF files can be utilized directly under Clipper, FoxPro and dBase. The version number that is embedded is III(3). The version number can be changed, if required.

   ##### Export Conversion for ADF files:

   Here, export of ADF files actually means reformatting of files. This option is helpful when the user is in need of altering the field sizes in a file. However, it should be noted that the present version does not allow the user to completely eliminate a field. A new field can be added only at the end of the output file. Hence, to achieve export (reformatting), user should take every precaution that field types are identical until the last field of the source file. The sizes and field names can be different. The example shown below is to guide the user for proper export (reformat) operation of '.ADF' files.

   Input File

   Field Name | Field Type | Length
   --- | --- | ---
   Name | A | 25
   Address | G | 30
   PAY-1 | N | 10

   Output File:

   Field Name | Field Type | Length
   --- | --- | ---
   Name | A | 30
   Address | G | 40
   PAY-1 | N | 12

   Numeric Fields:

   For numeric field conversion, the scanning is done from lower order byte to higher order byte. Hence, the following may be the net result in exported file:

   Input Field Less than Output Field ---- Result Always Correct
   Input Field Equal to Output Field ---- Result Always Correct
   Input Field Greater than Output Field ---- Result unpredictable

   Sign fields can be exported as it is or its position can be changed. It is preferable to have both input and output as signed fields if interchanging of sign position is needed. Otherwise again the results may be unpredictable.

   Example:

   Input File:

   Field Name | Field Type | Starting Col. | No. Of Characters
   --- | --- | --- | ---
   Name | A | 1 | 25
   Address | G | 26 | 30
   BPAY | N | 56 | 10
   Others | N | 66 | 10

   Output File:

   Field Name | Field Type | Starting Col. | No. Of Characters
   --- | --- | --- | ---
   Name | A | 1 | 30
   Address | G | 26 | 30
   BPAY | N | 56 | 12
   Others | N | 66 | 12

   In this case, the Original Name field, which is of size 25, will be converted into 30. BPAY and OTHER, which is of size 10, will be converted into 12. In case of Alphanumeric fields, the extended characters will be filled by spaces and in case of Numeric fields, it will be filled with Zeroes ('0'). This file can be further used by OdEan.

4. Transmigration for Date

   Another Important feature of this package is taking care of Year 2000 issue. User can create Format (Field Information File) for their old files with their old date type like ddmmyy, dd/mm/yy, DoyYy or YyDoy etc.,. and by providing a base year the same can be converted into DdMmYyyy DoyYyyy or YyyyDoy. The program automatically calculates the date conversion in the following manner when base year is specified properly. The paragraph shown below provides an example for Transmigration of Date. Assume that you have specified base year as 1950. Hence, any year that falls into a number >=50 (remember 2 digits only) will be taken as 19xx (1900 is added). In case if the year is < 50 the program will add 2000. Hence this value will be stored as 20xx. This may not be a total solution for all the ills of Year 2000 problem. However, some simple cost effective solution has been incorporated here. This transmigration should definitely help the organizations to at least breath normally since the date which would have set to ''00" will now have proper value 2000 in the files.

   Main Screen