COBOL Manual for TNS and TNS/R Programs
Tape Input and Output
HP COBOL Manual for TNS and TNS/R Programs—522555-006
27-18
Labeled Tape Files
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 system 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-9 adds a DEFINE for an unlabeled tape file with variable-length records.
The file is on the tape on the tape drive named $DRIVE.
Example 27-10 adds a DEFINE for an unlabeled tape file with fixed-length records.
The file is on the tape on the tape drive named $DRIVE, and it will not expire for five
days.
Labeled Tape Files
The attributes of labeled tape files are:
•
CLASS Attribute (Required)
•
LABELS Attribute (Required)
•
RECFORM Attribute (Conditional)
•
BLOCKLEN Attribute (Conditional)
•
RECLEN Attribute (Conditional)
•
DEVICE Attribute (Conditional)
•
FILESEQ Attribute (Conditional)
•
USE Attribute (Optional)
•
VOLUME Attribute (Optional)
•
RETENTION or EXPIRATION Attribute (Optional)
Caution. On a multiple-file volume, the system 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-9. DEFINE for Unlabeled Tape File With Variable-Length Records
ADD DEFINE =ABC, CLASS TAPE, DEVICE $DRIVE
Example 27-10. DEFINE for Unlabeled Tape File With Fixed-Length Records
ADD DEFINE =DEF, CLASS TAPE, DEVICE $DRIVE,&
BLOCKLEN 132, RETENTION 5