ACCESS MODE Clause - Format 4 - Transaction Files

IBM Extension
Read syntax diagramSkip visual syntax diagram
ACCESS MODE Clause - Format 4 - Transaction Files

>>-ACCESS--+------+--+----+--+-SEQUENTIAL--| Rel Key |-+-------><
           '-MODE-'  '-IS-'  '-DYNAMIC--| Rel Key |----'   

Rel Key

|--RELATIVE--+-----+--+----+--data-name-4-----------------------|
             '-KEY-'  '-IS-'                

End of IBM Extension
ACCESS MODE IS SEQUENTIAL
Can be specified for all three kinds of files.
Sequential
Records in the file are accessed in the sequence established when the file was created or extended (arrival sequence).
Relative
Records in the file are accessed in the ascending sequence of relative record numbers of existing records in the file.
Indexed
Records in the file are accessed in the sequence of ascending record key values according to the collating sequence of the file.
IBM Extension

When using an externally described file, if the DDS keyword DESCEND is used when the field is specified as a key field, the records in the file are accessed in the sequence of descending record key values within the index. Either the DESCEND keyword, or the ASCEND keyword (if DESCEND is not specified) appears under the heading RETRIEVAL in a comment table in the COBOL source program listing.

End of IBM Extension
ACCESS MODE IS RANDOM
Can be specified for relative and indexed files only. Also, ACCESS MODE IS RANDOM must not be specified for file names specified in the USING or GIVING phrase of a SORT or MERGE statement.
Relative
The value placed in a relative key data item specifies the record to be accessed.
Indexed
The value placed in a record key data item for the current key of reference specifies the record to be accessed.
ACCESS MODE IS DYNAMIC
Can be specified for relative and indexed files only.
Relative
Records in the file may be accessed sequentially or randomly, depending on the form of the specific input-output request.
Indexed
Records in the file may be accessed sequentially or randomly, depending on the form of the specific input-output request.