COBOL Manual for TNS and TNS/R Programs
Tape Input and Output
HP COBOL Manual for TNS and TNS/R Programsā522555-006
27-21
Labeled Tape Files
RECFORM Attribute (Conditional)
The RECFORM attribute is required unless you are bypassing labels (the value of the
LABELS attribute is BYPASS). The value of the RECFORM attribute must reflect the
type of records the tape has and must correspond to the RECORD CONTAINS clause
in the file description entry in the program.
BLOCKLEN Attribute (Conditional)
The BLOCKLEN attribute is required if the tape file has variable-length records (the
value of the RECFORM attribute is U) or if the tape file has fixed-length records (the
value of the RECFORM attribute is F), and the file description entry does not have a
BLOCK CONTAINS clause that specifies that the number of records per block is an
integer greater than one.
If the tape file has variable-length records, the value of the BLOCKLEN attribute
depends on the fileās maximum record size and open mode. If the open mode is
INPUT, the value of the BLOCKLEN attribute must be less than or equal to the
maximum record size; if the open mode is OUTPUT or EXTEND, the value of the
BLOCKLEN attribute must be greater than or equal to the maximum record size.
If the file has fixed-length records, the value of the BLOCKLEN attribute must be the
maximum record size, which is obtained from the BLOCK CONTAINS clause or from
the record description entry for the largest record.
RECLEN Attribute (Conditional)
The RECLEN attribute is required if the file has fixed-length records. Its value must be
the same as the value of the BLOCKLEN attribute (that is, the maximum record size).
If the record has variable-length records, the RECLEN attribute is unnecessary; if you
use it, its value is ignored.
Table 27-5. Correspondence Between RECORD CONTAINS Clause and
RECFORM Attribute Value
Record Length RECORD CONTAINS Clause RECFORM Attribute Value
Variable
(undefined)
RECORD CONTAINS min-length TO
max-length CHARACTERS
U
Fixed RECORD CONTAINS length-fixed
CHARACTERS
F