COBOL Manual for TNS and TNS/R Programs

Data Fundamentals
HP COBOL Manual for TNS and TNS/R Programs522555-006
4-8
Files
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.
Queue 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 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.
Table 4-3. Relationship Between File Organization and Access
Mode (page 1 of 2)
File Organization
Access Mode
Sequential Random Dynamic
Sequential
Line sequential
Program can read
records in the order
they were created,
one after the other.
Program can write
records one after
another.
If the file is in
Tandem reference
format and has
alternate keys, the
program can read it
in more than one
sequential order.
Not available Not available
* If the file is in Tandem reference format and has alternate keys, this characteristic also applies to the alternate
keys. For a description of Tandem reference format, see Reference Format for Source Program Lines
.
Table 4-2. File Organization (page2of2)
Organization Description