COBOL Manual for TNS and TNS/R Programs
Environment Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
6-25
FILE-CONTROL Paragraph
Table 6-4. Descriptions of File-Control Entry Clauses (page 1 of 2)
Clause Description
SELECT Defines the file name used to refer to the file in the
remainder of the source program. The OPTIONAL phrase
applies only to files opened in the INPUT, I-O, or EXTEND
mode. When such a file is not required to be present every
time the object program unit is executed, you can designate
it as optional.
Every file name in a SELECT clause must also be in a file
description (FD) entry or sort-merge file description (SD)
entry in the Data Division. Conversely, every file name in a
file description entry or sort-merge file description entry
must also be in a SELECT clause.
ASSIGN Associates the file name used within the program with an
operating system file. The operating system file name is the
one the operating system uses to refer to the file.
ORGANIZATION Specifies the logical structure of a file, which was
established when the file was created and which you cannot
change. The default is sequential organization.
RECORD DELIMITER Specifies the method of determining the length of a
variable-length record on the file’s physical medium. It can
appear only for a sequential file whose description specifies
variable-length records. HP COBOL handles the RECORD
DELIMITER clause as a comment.
ACCESS Specifies the order in which a process can read records
from the file. The default is sequential access.
When the access mode is sequential, a process can read
records from or write records to the file one after the other,
in an order that depends on the file’s organization (see
Table 6-5
).
When the access mode is random, you use key values to
specify the order in which a process reads or writes
records. The file-control entry specifies a data item to hold a
key value (see Table 6-6
).
When the access mode is dynamic, records can be
processed either sequentially or randomly.
ALTERNATE RECORD KEY See the paragraphs after Table 6-6
.