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

BLOCKLEN Attribute (Conditional)
LABELS Attribute (Optional)
RECFORM Attribute (Optional)
RETENTION or EXPIRATION Attribute (Optional)
CLASS Attribute (Required)
The value of the CLASS attribute must be TAPE. The CLASS attribute must be the first attribute in
the ADD DEFINE command, because it determines what other attributes the DEFINE can have and
clears any existing attribute settings, including any that precede it in the ADD DEFINE command.
DEVICE Attribute (Required)
The value of the DEVICE attribute must be the system file name of a tape drive.
BLOCKLEN Attribute (Conditional)
The BLOCKLEN attribute is required if the tape file has fixed-length records; that is, if the RECORD
CONTAINS clause in the file description entry is of the form
RECORD CONTAINS length-fixed CHARACTERS
the value of the BLOCKLEN attribute must be the same as:
The block size that the tape label specifies
The value of blk-2 in the BLOCK CONTAINS clause (if the tape file description entry has
one)
If the tape file has variable-length records, omit the BLOCKLEN attribute from the DEFINE. HP COBOL
programs cannot process blocked variable-length records.
LABELS Attribute (Optional)
The LABELS attribute must have the value OMITTED. With LABELS OMITTED, the system checks the
mounted tape for standard ANSI or IBM labels; if the tape has them, the system rewinds and
unloads the tape.
The LABELS attribute of the DEFINE overrides any LABEL RECORDS clause in your HP COBOL
program.
NOTE: The 1985 COBOL Standard classifies the LABEL RECORDS clause as obsolete, so you
are advised not to use it.
Table 113 Effect of LABELS Attribute and LABEL RECORDS Clause on Unlabeled Tape File
LABEL RECORDS Clause
LABEL RECORDS OMITTEDLABEL RECORDS STANDARDLABELS Attribute Value
Execution proceedsHP COBOL sets file status code to 97*
and execution proceeds
OMITTED
Execution proceedsOpen errorNone (no LABELS attribute)
* File status code 97 means that the statement executed successfully, but the circumstances were not entirely as expected.
RECFORM Attribute (Optional)
The value of the RECFORM attribute must correspond to the RECORD CONTAINS clause in the
file description entry in the program.
848 Tape Input and Output