COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-150
OPEN
•
Files Assigned to Disk Devices
When the object of an OPEN statement is a disk file, the presence or absence of
such a file on disk, as well as both the open mode and the file’s description,
determines what happens.
In all cases, a disk file cannot be described with a LINAGE clause in its file
description entry, nor can a WRITE statement that operates on a disk file include
an ADVANCING phrase.
•
Unstructured Disk Files
Unstructured files can be used by a COBOL program in only certain instances:
°
The program must specify sequential organization with no alternate keys.
°
The file contains zero or more complete records. For this to be true, one of
these must be true:
°
The COBOL program describes the records of the file as having an even
number of characters, and the file size is some integer multiple of the
record size.
°
The COBOL program describes the records of the file as having an odd
number of characters, the file system description of the file includes the
“odd-unstructured” attribute, and the file size is some integer multiple of the
record size.
Table 9-7. Open Modes for Files Assigned to Terminals
Open Mode Action
INPUT No carriage-control messages are sent to the file, and it cannot have a
LINAGE clause in its file description entry. READ, with or without the
PROMPT phrase, is the only I-O statement that can be executed on the file;
however, prompts are ignored in this open mode.
OUTPUT or
EXTEND
No carriage-control messages are sent to the file, and it cannot have a
LINAGE clause in its file description entry. WRITE, with or without the
ADVANCING phrase, is the only I-O statement that can be executed on the
file; however, “ADVANCING mnemonic-name,” if used, is ignored.
I-O No carriage-control messages are sent to the file, and it cannot have a
LINAGE clause in its file description entry. READ and WRITE statements
can be executed on the file, but DELETE, REWRITE, and START
statements cannot.