Index Option

Overview

The Index option defines the index (key) structures for the selected alias (file). The Index options, Edit and Load, including their subordinate options, are described below.

The descriptions of the options below refer to multiple-index definitions and assume the use of PRO/5 MKEYED files, which are the default. If DIRECT files or single-key MKEYED files are being defined, there is a limit of one index definition per alias. The mechanism for defining indexes for single-key and DIRECT files relies on the key information being available in the data record.

Each index consists of one or more index segments, up to a maximum of 48 segments. A segment may be a single field or part of a field.

The initial index is the primary, unique key of the file.

Edit

The Edit option is used to edit index definition parameters on a segment-by-segment basis. It is also possible to view the index data associated with an alias. Refer to Viewing Field and Index Data. If no data dictionary alias has been selected, the DD Editor prompts for one. The Index Options screen contains the index parameters.

This screen contains an Index Name window and a Current Segments window. Edit the Index Name and individual index segment definitions with the Add, Change, and Insert options.

Index Name

The following options are available in the Index Name window (type over the index name to rename the index):

<LIST>

List the fields in this record as possible index names.

<CANCEL>

Cancel any changes to this index.

<ENTER>

Accept the index name, and proceed to the Segments Options screen to edit index segment parameters.

The Index Segment parameters are:

Alias

This is a display-only field that contains the currently selected data dictionary alias.

Index

This is a display-only field containing the name of the index being edited.

Key Number

This is a display-only field that shows the current key number being edited.

Segment Number

This is a display-only field that shows the current segment number within this key (1 to 48).

Segment Type

Segment Type defines how this segment may be located.

Dependent (based on a named field). This is the default and the preferred method of defining segments. Dependent segments should be used whenever possible. If this type is selected, enter Field Name and Ascending parameters, which follow below.

Independent (based on a specific segment within the record). If an independent segment is selected, enter Field #, Offset, and Length parameters (described below).

Field Name

This parameter is entered for dependent segments only. Name the field the index is based on. When Field Name is entered, Field #, Offset, and Length are obtained from existing data dictionary parameters.

Field #

This parameter is entered for independent segments only. For the purpose of describing key segments, the field number is defined based on areas of the record delimited by linefeed characters (physical fields). If this record is made exclusively of fixed-length fields, the field number is 0 and indicates the complete record, ignoring delimiters.

Offset

This parameter is entered for independent segments only. The offset is zero-based. An offset of zero means the beginning of the named index segment field.

Length

This parameter is entered for independent segments only. The maximum segment length is 64 bytes. An index must be located in the first 1024 bytes of the record.

For example, a 10-byte, independent segment, starting at the third byte of physical field 7, would be defined as:

Field # 7, Offset 2, Length 10.

Description

This parameter contains a text description of the index segment.

Ascending

This parameter selects the collating sequence of this segment for dependent or independent segments only. Type "Y" to select ascending sequence, or "N" to select descending sequence. The default is ascending sequence.

Unique Key?

Is this segment unique? This parameter is only meaningful for single-segment keys or the first segment of a concatenated index. Type "Y" for unique, or "N" for not unique. The primary index must be unique.

BusMath Sort

If a Business Float type field is specified as an index, the BusMath Sort option can be selected to make records accessed using this index sort correctly. If the BusMath Sort option is not selected, then sorting will be alphabetic instead of numeric.

Ending Index, Edit

After editing the segment parameters, follow the instructions in the short help at the bottom of the screen to accept or reject any changes, additions, or deletions.

After returning to the Segment Maintenance window, select another index segment and action to continue editing, or press <CANCEL> to return to the Index Maintenance screen. After returning to the Index Maintenance screen, select another index to edit (and the desired action), or press <CANCEL> again to return to the Data Dictionary main menu.

Delete

The Delete option is described under Deleting Field and Index Definitions.

Load

The Load Index option is used to load indices based on the key structure of an existing multi-keyed MKEYED file. It names indices according to the following rules:

  • If the index corresponds exactly to a single field defined in the record, the index will be named the same as the field.

  • In all other cases, the index will be generically named "INDEX" plus the KNUM of the index. For example, the index for KNUM=2 would be assigned the name "INDEX02".