FileMaint Option
Overview
The FileMaint option provides the capability to create, edit, delete, and copy the global file and record characteristics of data files. In addition, the actual data file can be created from the file definition. The FileMaint options, Load, Edit, Delete, Copy, and Make—along with their options—are described below.
Load
The Load option selects a database alias to work with. The DD Editor prompts for an alias in a dialog window. Enter an existing alias (or a new alias to be created), or press <LIST> to select a previously defined alias from the data dictionary. The DD Editor loads the selected alias definition. Another option can then be selected perform various operations on or with the definition.
Here, a new alias definition can be created. Type "Y" to create a data dictionary entry for this alias, then select Edit to define its parameters. To cancel the entry, press <EXIT> or Enter, or type "N". The alias can then be reentered.
Edit
The Edit option is used to change the parameters for this alias. If no data dictionary alias has been selected, a prompt is given to provide one. The File Maintenance Options screen contains the file header parameters.
Move through the on-screen form to enter the information. Use the up and down arrow, Enter, and <JUMP> keys to move from field to field to define the following file header parameters:
Alias
The alias is a display-only field carried forward from the initial screen for reference. (An alias is the data dictionary reference to a file name.)
Description
This is textual description of the alias. The Description parameter may contain up to 128 characters.
Path
The Path parameter defines the directory and file name of the data file associated with this alias. By default, a name is generated based on the (DATA) global path. The file name is forced to lower case with the extension .dat. For example, the alias ITEM generates the default file name (DATA)item.dat.
The DD Editor resolves the (DATA) global at run time, based on the value in the config.TPM file.
If the alias loaded already exists, the DD Editor automatically fills in the Type, Key Size, Record Length, and # of Records parameters.
Status
A display-only field that provides information about the data file associated with the alias. It indicates if the file exists or if the indices are correct. If the file does not exist, use the Make option to create it.
Type
Enter the PRO/5 file type. Press <LIST> to select from the following list:
Type Code |
Type |
Description |
0 |
INDEXED |
INDEXED files have a fixed record length and may contain a dynamic number of records. Records can be accessed either sequentially, or randomly by record number. |
1 |
SERIAL |
SERIAL files are sequential files with variable length records and a dynamic file size. |
2 |
DIRECT/SORT |
A DIRECT file is created by selecting Type Code 2 and entering a Record Length parameter greater than 0. DIRECT files have a fixed number of records and a fixed record length. This file type has been largely superseded by MKEYED files but may be needed to describe existing files. |
3 |
STRING |
A STRING file contains a continuous string of characters. A STRING file has no defined records and grows dynamically as the file is written. This file type is also called ASCII. |
4 |
PROGRAM |
Reserved |
5 |
DIRECTORY |
DIRECTORY files contain lists of file names. These files may be accessed only as read-only SERIAL files. |
6 |
MKEYED |
A single-key MKEYED file is created if a Key Size parameter (see below), or a multiple-key MKEYED file is entered and the Key Size set to 0. |
7 |
C-ISAM |
C-ISAM files are keyed files similar to MKEYED files and are compatible with INFORMIX C-ISAM files. |
The default file type for newly created files is multiple-key MKEYED, with the record length calculated from the defined record structure.
Key Size
Key Size is only significant for Type Code 2 (DIRECT and SORT) files or Type Code 6 (MKEYED) files in single-key mode. For multiple-key MKEYED files and INDEXED files, key size does not apply.
Record Length
The Record Length parameter defines the physical record size of the file. If set to 0 (the default), the record size is calculated based on the fields defined in the record. The resulting record size is a Soft Record Length. For KEYED files (Type Code 2), a Record Length parameter of 0 defines the field as a SORT file. Record Length is displayed as N/A for previously defined SORT files.
A Hard Record Length occurs when a number is entered for the Record Length. If a record contains many variable fields that are never fully used, entering a smaller record size saves disk space.
# of Records
The use of this field varies based on the file type:
File Type |
Number of Records |
INDEXED |
Enter a positive number from 1 to 999,999,999 to create a fixed-length file, or enter 0 for a dynamically created file. |
SERIAL |
Not applicable. |
DIRECT/SORT |
For DIRECT and SORT files, select a number of records from 1 to 999,999,999. These file types cannot be created with a dynamic number of records. |
STRING |
Not applicable. |
PROGRAM |
Not applicable. |
DIRECTORY |
Not applicable. |
MKEYED |
Enter a positive number from 1 to 999,999,999 to create a fixed-length file, or enter 0 for a dynamically created file. |
C-ISAM |
Enter a positive number from 1 to 999,999,999 to create a fixed-length file, or enter 0 for a dynamically created file. |
After editing the file and record parameters, follow the instructions in the short help at the bottom of the screen to accept or discard any changes, additions, or deletions.
Record Terminator
The character(s) indicating the end of variable length records in a STRING file. This information is stored in the data dictionary for use by applications that use these files.
Enter the hexadecimal representation of the character(s). For example, if a string file contains variable length records terminated by a linefeed character, enter 0A in this field. If the variable length records in a string file are terminated by ^M^J, enter 0D0A in this field.
Delete
This option removes the definition of an alias from the data dictionary, including field and index definitions. It also provides an option to remove the associated data file.
First, select the Delete option from the FileMaint submenu. The DD Editor prompts for the alias to be deleted. The currently loaded alias (if any) is the default. Press <LIST> to choose from the list of currently defined aliases. Or, press <CANCEL>, Enter, or type "N", to terminate the Delete option without deleting anything.
The selected alias appears at ALIAS in the prompt. Pressing <EXIT>, Enter or typing "N" at this point, terminates the Delete option without deleting anything. The alias can only be deleted by typing "Y" at this prompt.
If an alias definition is deleted, the DD Editor prompts to determine if the data file associated with the deleted alias should also be deleted. Press <EXIT>, Enter, or type "N" to terminate the Delete option without deleting anything. The data file can only be deleted by typing "Y" at this prompt.
Copy
The Copy option copies the complete file definition from one alias to another. This feature is used when defining a new file that is similar to an existing file. Only the DD definition is copied. The Copy option does not copy records from one data file to another.
The DD Editor prompts for the alias to be copied, with the currently loaded alias (if any) as the default. A different alias may be entered, or press <LIST> to choose from the list of currently defined aliases. Press <EXIT> to terminate the Copy option without copying anything.
After entering the alias, the DD Editor prompts for the alias of the file to copy into. There is no default and no search function is defined because the new file does not yet exist. Press <EXIT> to exit. After creating the new alias, it will be loaded and available for editing.
Make
The Make option is used to create data files related to the current alias. The suboptions are File and Template.
File
The File option creates the data file named in the Path parameter for the currently loaded alias. If a valid set of parameters is currently loaded (file/record attributes, fields, and indices), the file will be created with no further input. The Status message will change from Non-existent to Exists. Current.
The Make, File option can also be used to clear the data from an existing file. Press <EXIT>, Enter, or type "N" to leave the file unchanged. Here, the only options are to erase or remake the file by typing "Y" at the prompt.
CAUTION! Erasing and remaking a file causes all data to be lost.
Template
PRO/5 string templates are the vehicle used for exporting record layouts from the data dictionary and for importing record layouts to the data dictionary. The Template option prompts for a file name and creates an ASCII string file with that name. It then writes one record containing the string template that defines the record structure to that file.