Defining Key Information

If you are creating a data layout for an indexed file, you can use the File Designer's Key tab to specify one or more keys. Rules for primary and alternate keys can be found in Environment Division.

All of the fields that you define in the Description tab appear in the Fields description list in the bottom, left portion of the interface. Use this list to build your key(s) as follows.

  1. In the Fields description list, double-click an item to add it to the Selected Fields list. You can also click an item (or Shift-click or Ctrl-click to select multiple items), then click the right arrow (>) to add them to the Selected Fields list. To add all fields to the list, click the >> button.

    All fields in the Selected Fields list when you create a new key are added to the key. If you have mistakenly added a field to the list, use the left arrow (<) button to remove it. To clear the Selected Fields list, use the << button.

  2. To add the fields in the Selected Fields list as a key, click the Add button (first in the set of four to the right of the Key list label). You can also right-click in the Key list area and select Add. The selected fields appear in the Key list.

    This two-step process for creating keys makes it easier to add split keys, constructed from multiple non-contiguous fields.

  3. To add or change a key name, double-click in the Key Name field and enter the name.
  4. To change key type (unique primary, primary allowing duplicates, unique alternate key, alternate key allowing duplicates), double-click in the Type field and select an option from the drop-down list.
  5. To insert a comment, click in the Comment field and then click the button that appears.

To change a key for an indexed file:

  1. In the Key list select the key that you want to change. Note that the key fields of the selected key are listed in the Selected Fields list.
  2. Add or subtract items from the Selected Fields list until you have the fields that you want.
  3. Change the key by clicking the Modify button (second in the set of four to the right of the Key list label).

To remove a key, select the key in the Key list, then click the Delete button (third in the set of four buttons to the right of the Key List label). To clear all of the key definitions and start again, use the Delete All button (the fourth button in the set).

When you are finished defining and editing key information, you can do any of the following: