SELECT file-name ASSIGN TO UT-ddname ORGANIZATION IS RELATIVE ACCESS MODE IS SEQUENTIAL / RANDOM / DYNAMIC RELATIVE KEY IS data-name-1 FILE-STATUS IS data-name-2 data-name-3.
- The RELATIVE KEY clause identifies a data-name that specifies the relative record number for a specific logical record within the relative file. Data-name-1 must be defined as an unsigned integer data item and must not be included in the record description entry for the data set. That is the relative key is not part of the record.
- When ACCESS MODE IS SEQUENTIAL the Relative Key data field need not be specified unless the START statement (see page 10) is to be used. When the START statement is used the contents of data-name-1 are used to determine where processing of the data set is to begin. If a value is put into the Relative Key field, and a START statement is not used, then the value is ignored and processing begins with the first record in the file.
- For RANDOM or DYNAMIC access the Relative Key field must be specified and a value inserted as it is used to obtain the record with that relative record number