Access Mode

In sequential access mode, records are accessed in the ascending order of the record key values, except that, if the program specifies the PREVIOUS phrase, records are accessed in the descending order of the record key values. Records within a set of records that have duplicate record key values are retrieved in the order in which the records were written into the set, except that, if the program specifies the PREVIOUS phrase, records are retrieved in the reverse order in which the records were written into the set.

In random access mode, you control the sequence in which records are accessed. The desired record is accessed by placing the value of its record key in the record key data item.

In dynamic access mode, you can change at will between sequential access and random access, using appropriate forms of input/output statements.