The key clause identifies the key or keys of the Access.
All key items must be data items or group items in the data set referenced by the Access. When multiple key items appear, the key items are listed from left to right in order of significance. The leftmost key item is the major key.
When group key items contain signed numeric or real items, the set cannot necessarily be ordered ascending by key. Normalization or transformation is not performed on signed numeric and real items that are within group items because group items are aligned on an 8-bit byte boundary. To ensure correct ordering for sets, change the group key to a multiple key item.
When group keys contain alpha items or numeric items, the set can contain some extra padded digits if the numeric items are not byte-aligned. To ensure no extra padded digits are in the set, use multiple key items rather than a group item key, or make all numeric items within the group byte-aligned.
The following restrictions apply to key items:
The ASCENDING and DESCENDING options can be specified only for Accesses to ordered data sets. When the ASCENDING option is used, records with low key values precede records with high key values. When the DESCENDING option is used, records with high key values precede records with low key values. If neither the ASCENDING nor DESCENDING option is specified, an ascending order is assumed.