14.3 Record Access and Record Context
Record access modes determine the order in which your
program retrieves or stores records in a file. They determine
the record context: the current record and the next record to
be processed. When your program successfully executes any
record operation, the current record and next record point-
ers can change. If a record operation is unsuccessful, these
pointers do not change.
The record access modes valid for RMS are as follows:
With sequential access, the next record is the next logical
record in the file. In the case of relative files, the next logical
record is the next existing record (deleted or never-written
records are skipped). In the case of indexed files, the next
logical record is the record with the next ascending or de-
scending value in the current key of reference depending on
that key's collating sequence. You can therefore access rel-
ative or indexed files sequentially by not specifying a relative
record number or key value.
You can also access sequential fixed-length and relative files
randomly by record number; that is, you can specify the
record number of the record to be retrieved. For relative files,
this record number corresponds to the cell number of the
desired record.
You can access indexed files randomly by key. The key spec-
ification includes a primary or alternate key and its value.
BASIC retrieves the record corresponding to that value in the
particular key chosen.
You can access disk files of any organization by Record File
Address (RFA); this means that you specify an RFA variable
whose value uniquely identifies a particular record. The RFA
requires six bytes of information. For more information about
RFAs, see Section 14.6.10.