COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Table 16 File Organization (continued)
DescriptionOrganization
operation by providing the value of its relative record number. Because a
program can fill or empty individual record areas independently, without regard
to the presence or absence of logical records in any of the other areas, any
combination of record areas can be full or empty at any given time in the file’s
existence.
Under the NonStop operating system, COBOL relative files are relative files.
An indexed file is organized as a set of records uniquely identified by the values
of their prime record key, a data item defined within each logical record of
Indexed
the file. A program can select any record for an operation by providing the
value of its prime record key.
Under the NonStop operating system, COBOL indexed files are key-sequenced
files.
A queue file is an indexed file (and therefore, a key-sequenced file) that can
function as a queue. Processes can queue and dequeue records in a queue
file.
Queue
Queue files contain variable-length records that are accessed by values in
designated key fields. Unlike other key-sequenced files, queue files have prime
keys but cannot have alternate keys. The prime key for a queue file includes
an 8-byte timestamp; you can add a user key if desired. The disk process inserts
the timestamp when each record is inserted into the file, and maintains the
timestamp during subsequent file operations.
Access Mode
The access mode of a file specifies the manner in which the records of the file are to be manipulated:
sequential, random, or dynamic. Access mode is a dynamic attribute, described in the COBOL
source program that specifies the manner in which the object program unit operates upon records
in the file. The access modes available to a file depend on its organization.
Table 17 Relationship Between File Organization and Access Mode
Access Mode
DynamicRandomSequentialFile Organization
Not availableNot availableProgram can read records
in the order they were
Sequential
created, one after the other.
Program can write records
one after another.
If the file has alternate keys,
the program can read it in
more than one sequential
order.
Not availableNot availableProgram can read records
in the order they were
Line sequential
created, one after the other.
Program can write records
one after another.
Program can select records
sequentially (with READ
Program can select records
from anywhere in the file by
Program can select records
in increasing order of
Relative
NEXT statements) orspecifying relative recordrelative record number
randomly (with READ
statements).*
numbers. Records need not
exist or have contiguous
record numbers.*
(ignoring empty record
areas).* Relative record
numbers begin at 1.
Program can select records
sequentially (with READ
Program can select records
from anywhere in the file.*
Program can select records
in increasing order of prime
Indexed
82 Data Fundamentals










