COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
BYPASS tells the system to handle a labeled tape file like an unlabeled tape file. The labels are
interpreted as data. Use BYPASS if either of these is true:
• The tape has labels that are not ANSI or IBM standard.
• The HP COBOL program does its own label processing.
The LABELS attribute of the DEFINE overrides any LABEL RECORDS clause in your HP COBOL
program.
Table 115 Effect of LABELS Attribute and LABEL RECORDS Clause on Labeled Tape File
LABEL RECORDS Clause
LABEL RECORDS OMITTEDLABEL RECORDS STANDARDLABELS Attribute Value
HP COBOL sets file status code to 97*
and execution proceeds
Execution proceedsANSI or IBM
Execution proceeds and HP COBOL
handles any labels as data
HP COBOL sets file status code to
97*, execution proceeds, and
HP COBOL handles any labels as data
BYPASS
* File status code 97 means that the statement executed successfully, but the circumstances were not entirely as expected.
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.
Table 116 Correspondence Between RECORD CONTAINS Clause and RECFORM Attribute Value
RECFORM Attribute ValueRECORD CONTAINS ClauseRecord Length
URECORD CONTAINS min-length
TO max-length CHARACTERS
Variable (undefined)
FRECORD CONTAINS length-fixed
CHARACTERS
Fixed
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.
Adding DEFINEs for Tape Files 851










