COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

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.
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.
NOTE: The 1985 COBOL standard classifies the MULTIPLE FILE clause as obsolete, so you are
advised not to use it.
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.
Table 117 Corresponding Open Modes and USE Attribute Values
USE Attribute ValueOpen Mode
IN or OPENFLAGINPUT
OUT or OPENFLAGOUTPUT
EXTEND or OPENFLAGEXTEND
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.
VOLUME Attribute (Optional)
The VOLUME attribute identifies the tape. The value of the VOLUME attribute must be the name of
the tape volume as it appears in the tape label. This automatic volume recognition enables you or
the operator to mount the labeled tape on any available tape drive before or after you start your
HP COBOL program.
After locating the tape volume on a device, the operating environment passes the DEFINE to the
tape process that controls the device. The tape process checks the values in the tape labels against
the values of the DEFINE attributes. If the values do not match, the operating environment rejects
the open request and issues an error message. If the values match, the operating environment
approves the open request, and the HP COBOL process can use the tape file.
RETENTION or EXPIRATION Attribute (Optional)
Use the RETENTION or EXPIRATION attribute when you want to save a file for any period of time,
even part of a day; otherwise, the file expires as soon as you write it, and the operating environment
might overwrite the file.
852 Tape Input and Output