Relative Organization

Think of the file as a string of record areas, each of which contains a single record. Each record area is identified by a relative record number; the access method stores and retrieves a record, based on its relative record number. For example, the first record area is addressed by relative record number 1, and the 10th is addressed by relative record number 10. Relative files must be assigned to DISK or DATABASE.

Table 1 summarizes conditions affecting relative output files.

Table 1. Initialization of Relative Output Files
File Access and CL Specifications Conditions at Opening Time Conditions at Closing Time   File Boundary
Sequential *INZDLT   Records not written are initialized All increments
Sequential *INZDLT *NOMAX size   CLOSE succeeds File status is 0Q Up to boundary of records written
Sequential *NOINZDLT     Up to boundary of records written
Random or dynamic Records are initialized File is open   All increments
Random or dynamic *NOMAX size OPEN fails File status is 9Q   File is empty

To recover from a file status of 9Q, use the CHGPF (Change Physical File) command as described in the associated run-time message text.

Relative record number processing can be used for a physical file or for a logical file that is based on only one physical file.