Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Sequential access to records

Records in a relative file may be sequentially created, read, and updated.

A relative file may be created sequentially, in which case the RELATIVE KEY need not be specified, as the records are written to the output file in physically consecutive order.

In sequential reading of records from a relative file, the records are processed in the order of their relative record numbers, i.e. a READ statement will make available the next or preceding existing logical record of the file. The first record that is read is either the first record made available in the file, or a record whose position was specified in a START statement. In the latter case, RELATIVE KEY must be specified.

If the RELATIVE KEY is specified for a relative file, execution of a READ or WRITE statement causes the RELATIVE KEY item to be set to the relative record number of the record which is made available.

An already existing relative file may be updated with the aid of READ, REWRITE, or DELETE statements. The last record read may be updated and then rewritten to its original location in the file, or it may be logically deleted.