COBOL Manual for TNS and TNS/R Programs

Environment Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
6-47
FILE-CONTROL Paragraph
File-Control Entries for Indexed Files
Indexed organization provides the capability to read records from and write records to
a disk file either randomly or sequentially. In an indexed file, the value of the prime key
of each record uniquely identifies that record. A file-control entry for an indexed file
includes an ORGANIZATION INDEXED clause.
SELECT clause
OPTIONAL
makes the file optional, which means that an OPEN statement with an INPUT,
I-O, or EXTEND phrase can open the file whether or not the file exists. If the
file exists, its I-O status code is “00”; if not, its I-O status code is “05”.
OPTIONAL does not affect the OPEN statement with an OUTPUT phrase.
When you open a nonexistent optional file for input, the first READ statement
for that file uses the AT END option (or USE procedure if the READ statement
has no AT END phrase).
SELECT clause ASSIGN clause
RESERVE clause
ORGANIZATION clause
.
ACCESS MODE clause
ALTERNATE RECORD KEY clause
FILE STATUS clause
RECORD KEY clause
VST051.vsd
SELECT
file-name
OPTIONAL
VST038.vsd