COBOL Manual for TNS/E Programs (H06.03+)
Data Division
HP COBOL Manual for TNS/E Programs—520347-003
7-16
File Description Entries
°
Tape Files
If the actual file associated with the COBOL file at open time is a tape unit,
then blocking/deblocking always occurs. For an unlabeled tape file, the
maximum block size is the one specified in the BLOCK CONTAINS clause. For
a labeled tape file, the maximum block size specified in the tape label (which
must be an exact multiple of the logical record size) overrides the one specified
in the BLOCK CONTAINS clause.
If the file is opened for INPUT, then each physical block on the tape medium
must contain one or more complete logical records. The size of a block must
not exceed the maximum block size; however, any block can be smaller than
the maximum block size (can contain fewer than the potential number of logical
records).
°
Unstructured Disk Files
If the actual file associated with the COBOL file at open time is an unstructured
disk file, then blocking/deblocking occurs if the logical record size is an even
number of character positions or the file has the odd-length access attribute;
otherwise the BLOCK CONTAINS clause is ignored (that is, logical records are
physically read or written one at a time). (To have the odd-length access
attribute, a file must be created with FUP CREATE and ODDUNSTR must be
specified.)
Odd-length records are written as even-length unless ODDUNSTR is active.
The compiler issues a warning if blocking is specified when the conditions,
other than variable-length records, are not satisfied.
RECORD CONTAINS Clause
Use the RECORD CONTAINS clause to specify whether the records of a file are of
fixed or variable length and to document the size of the records.
contains-phrase-fixed
RECORD
contains-phrase-fixed
«contains-phrase-range»
VARYING phrase
VST078.vsd
length-fixed
CONTAINS
CHARACTERS
VST079.vsd










