COBOL Manual for TNS/E Programs (H06.03+)
Procedure Division Verbs
HP COBOL Manual for TNS/E Programs—520347-003
9-141
OPEN
•
HP COBOL Queues Printer File Records
HP COBOL queues write operations to files that are associated with printers and to
processes that behave like printers. The LINAGE clause of the file description
entry and the ADVANCING phrase of the WRITE statement are valid only for such
files.
Records that HP COBOL writes to a process are queued only when the OPEN
statement specifies an attribute of OUTPUT, EXTEND, or I-O, and at least one of
these is true:
°
The file description entry includes a LINAGE clause
°
The OPEN statement discovers that the process with which it is associating the
file has the device subtype attribute value of 31
OUTPUT If the record length of the physical file is shorter than the record length
declared in the File Section, the file is not suitable for use:
•
If no alternate record keys exist, the file is purged and a new one is
created. The new file has file code 0 unless the COBOL_ASSIGN_
routine or the TACL command ASSIGN provides another file code
value. The new file has the standard HP COBOL defaults for file size
and number of extents, rather than the size and extents of the original
file.
•
If alternate record keys exist, the file cannot be purged, and the open
operation fails with I-O status code “30.”
If the record length of the physical file is not shorter than the record length
declared in the File Section, and the file contains some data, the file is not
purged, but its data is purged. In either case, no warning alerts you that a
purge is taking place. After the file is purged, the file position indicator is set
to either of these, depending on the file’s organization:
•
The first record in a sequential file
•
An undefined value for an indexed, queue, or relative file, because the
file contains no records at that point
EXTEND If the record length of the physical file is shorter than the record length
declared in the File Section, the file is not suitable for use. The open
operation fails with I-O status code “30.”
The file position indicator is set to the end of the file.
I-O If the record length of the physical file is shorter than the record length
declared in the File Section, the file is not suitable for use. The open
operation fails with I-O status code “30.”
The file position indicator is set to the first record in the file.
Table 9-9. Open Modes for Structured Disk Files Present at Run
Time (page 2 of 2)
Open Mode Action










