COBOL Manual for TNS and TNS/R Programs

Tape Input and Output
HP COBOL Manual for TNS and TNS/R Programs522555-006
27-23
Labeled Tape Files
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.
The value of the RETENTION or EXPIRATION attribute is an integer, the number of
days before the file expires.
Example 27-11 adds a DEFINE for a labeled tape file with variable-length records
whose labels are to be bypassed. The file is on the tape on the tape drive named
$DRIVE.
Example 27-12 adds a DEFINE for a labeled tape file with standard IBM labels and
variable-length records. The file is on the tape on the tape whose volume ID is 45329,
and it will not expire for 100 days.
Example 27-13 adds a DEFINE for a labeled tape file with standard ANSI labels and
fixed-length records. The file is the second file on the tape, and it will not expire for 10
days.
Caution. On a multiple-file volume, the operating environment might overwrite an unexpired
file that follows an expired one; a volume on which the first file has expired is a scratch volume.
Example 27-11. DEFINE for Labeled Tape File With Variable-Length Records and
Labels to Be Bypassed
ADD DEFINE =ABC, CLASS TAPE, LABELS BYPASS,&
BLOCKLEN 132, DEVICE $DRIVE
Example 27-12. DEFINE for Labeled Tape File With Variable-Length Records and
Standard IBM Labels
ADD DEFINE =DEF, CLASS TAPE, LABELS IBM, RECFORM U,&
BLOCKLEN 132, VOLUME 45329, RETENTION 100