COBOL Manual for TNS and TNS/R Programs

Tape Input and Output
HP COBOL Manual for TNS and TNS/R Programs522555-006
27-22
Labeled Tape Files
DEVICE Attribute (Conditional)
The DEVICE attribute is required if you are bypassing labels (the value of the LABELS
attribute is BYPASS); otherwise, it is optional.
When the DEVICE attribute is required, its value must be the system file name of a
tape drive.
On a D-series system: Before the HP COBOL process can use the tape, the operator
must use the Tape Utility Program (TAPECOM) command ACCEPT to approve
opening the tape. Alternatively, the operator uses the TAPECOM command CLEAR
NLCHECK to set the system so that processes can open unlabeled tapes without
approval. Anyone using TAPECOM from a super-group user ID (255,nnn ) can act as
an operator.
When the DEVICE attribute is optional, its value overrides the system’s automatic
volume recognition. You cannot specify a different device in response to the system
mount message.
FILESEQ Attribute (Conditional)
The FILESEQ attribute is required if the file you want to use is not first on the tape or if
your HP COBOL program has a MULTIPLE FILE clause. If you omit FILESEQ and the
COBOL program does have a MULTIPLE FILE clause, the open operation fails.
The value of the FILESEQ attribute specifies the position of a labeled tape file on a
multiple-file tape. It must be an integer in the range 1 through 9999 (relative file
positions are consecutive integers from 1 through 9999) and must match the value in
the corresponding field of the tape label.
USE Attribute (Optional)
The USE attribute prevents inadvertent overwriting of a tape file. The value of the USE
attribute must correspond to the tape file’s open mode.
The values IN, OUT, and EXTEND have the same meanings as the corresponding
open modes; OPENFLAG means that the file can be opened in any mode that the
OPEN statement specifies.
Note. The 1985 COBOL standard classifies the MULTIPLE FILE clause as obsolete, so you
are advised not to use it.
Table 27-6. Corresponding Open Modes and USE Attribute Values
Open Mode USE Attribute Value
INPUT IN or OPENFLAG
OUTPUT OUT or OPENFLAG
EXTEND EXTEND or OPENFLAG