COBOL/400 Language Help

Data-name-1

Data-name-1 specifies a KEY data item on which the sort will be based. Each such data-name must identify a data item in a record associated with file-name-1. The data-names following the word KEY are listed from left to right in the SORT statement in order of decreasing significance without regard to how they are divided into KEY phrases. The leftmost data-name is the major key, the next data-name is the next most significant key, and so forth. The following rules apply:

  1. A specific KEY data item must be physically located in the same position and have the same data format in each input file. However, it does not need to have the same data-name.
  2. If file-name-1 has more than one record description, then the KEY data-items need to be described in only one of the record descriptions.
  3. KEY data items must be fixed-length items.
  4. KEY data items must not contain an OCCURS clause or be subordinate to an item that contains an OCCURS clause.
  5. KEY data items can be qualified or reference modified; they cannot be subscripted or indexed. (Click here for information about reference modification.)
  6. The total length of the KEY data item must not exceed 256 bytes.


[ Top of Page | Previous Page | Next Page | Table of Contents ]