COBOL Manual for TNS and TNS/R Programs
Environment Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
6-26
FILE-CONTROL Paragraph
The ALTERNATE RECORD KEY clause specifies an alternate record key (designated
in the syntax as altkey ) for the file. Each altkey must reference an alphanumeric
or unsigned numeric data item defined in a record description entry associated with its
file name. In either case, the collating sequence is ASCII—using tricks to allow
altkey to be a signed numeric data item causes problems.
An altkey cannot reference an item whose size is variable. The presence or
absence of the DUPLICATES phrase specifies whether or not the value of this
alternate record key can be duplicated among the records in the file.
If more than one record in a file has the same alternate record key value then when a
program reads the file according to the alternate record key, the records are presented
to the program either in either prime record key order or in the chronological order of
their insertion into the file. The 1985 ISO/ANSI COBOL standard specifies insertion
order, but HP COBOL provides a mechanism to enable you to choose either order.
FILE STATUS The FILE STATUS clause specifies the identifier
(designated in the syntax as filestat ) that is to serve as
the file-status data item for the file. When a COBOL run-
time I-O routine completes an operation on the file, it stores
the status code in the file-status data item before returning
control to your program.
The identifier filestat must reference an alphanumeric
data item with a size of exactly two characters. The data
item must be defined in the Working-Storage Section,
Extended-Storage Section, or Linkage Section of the Data
Division.
Table 6-5. Sequential Access
File Organization
Records are read by ascending alternate key
or processed in the order …
Sequential,
Line sequential
that they are written, from the first physical record to the last
Relative of ascending relative record numbers
Indexed of ascending record key values within a given key
Table 6-6. Random Access
File Organization Next record to be processed is determined by the value of …
Relative RELATIVE KEY or ALTERNATE RECORD KEY data item
Indexed RECORD KEY or ALTERNATE RECORD KEY data item
Table 6-4. Descriptions of File-Control Entry Clauses (page 2 of 2)
Clause Description