Defining Keys |
|
A key is a string of characters that are used to identify the records in a file. Define the Primary and Alternate keys for the physical file by clicking the Define Keys button on the Data Dictionary Maintenance tool bar or by selecting File > Define Keys from the menu bar.
Primary Key
If a primary key has not yet been defined, clicking the Define Keys button will display a message, asking to define it. Respond Yes to invoke the Key Definition window, which is used to select the data fields and the sort order that will make up the primary key. Key segments can be composed of one or more strings or sub-strings.
If the key is external, select the External check box option; otherwise, the key will be considered internal. An external key can be made up of segments and can include a mixture of external-only and duplicated elements. The Unique check box option is selected by default.
Alternate Keys
Once a primary key is defined, you will be able to include up to 15 alternate keys with a total of 96 segments (FLR/VLR). EFF files can have a maximum of 255 keys and 255 segments per key.
Keys that have been defined are displayed in the Key Definition list when the Define Keys option is selected on the tool bar or from the File menu.
This window consists of the following:
New Key |
Invokes the Key Definition window for defining a new key. |
Modify |
To modify an existing key, select the key from the list and then click the Modify button, which invokes the Key Definition window for the selected key. |
Delete |
To remove an existing key, select the key from the list and then click the Delete button. Prior to deletion, a message will display. Note:
|
Move Up |
To change the order of alternate keys, use the Move Up/Down buttons to move the selected key up or down within the Key Definition list. Note:
|
The Key Definition window identifies the new or selected key in the title bar, either as a Primary Key or as an Alternate Key (displaying the Key # number/KNO).
This window consists of the following:
Data Fields |
Lists the defined Data Elements for the selected file. You can select these to construct the key. | ||||||||||||
Key Segments |
Lists of all the data elements that currently make up the key. | ||||||||||||
Ascending |
Button used to insert the selected element from the Data Fields list into the Key Segments list. Sort order for this portion of the key is ascending. | ||||||||||||
Descending |
Button used to insert the selected element from the Data Fields list into the Key Segments list. Sort order for this portion of the key is descending. | ||||||||||||
Binary Increment |
Button used to define binary auto increment for the key, record-based, by the Record Offset (base 1) and Length (1, 2 or 4 bytes). Segments may be designated as swapped (same as SWP( ) type 7, Intel x86 type swapping only). | ||||||||||||
Remove |
Button used to remove the selected segment from the key definition. | ||||||||||||
| |||||||||||||
Partial Field |
Defines a portion of a data field (sub-string options). A separate window displays with the following options:
| ||||||||||||
Segment Options |
Sets different segment options for the selected segment. A separate window displays with the following options:
Note: | ||||||||||||
Key Name |
Used for entering a valid key name. | ||||||||||||
OK |
Saves any changes and exits the Key Definition window, returning to the Key Definition list. If a new key was defined, it will be added to the bottom of the list. | ||||||||||||
Cancel |
Closes the Key Definition window without saving any changes. |