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

Data Division
HP COBOL Manual for TNS/E Programs520347-003
7-15
File Description Entries
CHARACTERS
specifies that the values of blk-1 and blk-2 represent numbers of character
positions. This is the default.
Usage Considerations:
Limits
The minimum number of character positions you can specify is equal to the
maximum record size of the file. If you specify more than 32,767 character
positions, the compiler reports an error.
If you specify a number of records greater than 32,767 divided by the maximum
record size for the file, the compiler reports an error.
When blk-1 is present, its value must be less than or equal to that of blk-2.
When the RECORDS option is not specified, the value of blk-1 must be greater
than or equal to the minimum record size of the file; otherwise, the value of blk-1
must be greater than 0.
Although tape devices are capable of handling blocks of 32,767 characters,
unstructured disk files are limited to a block size of 4,096. Furthermore, an
unstructured disk file can have a BLOCKSIZE attribute that is smaller than 4,096.
Other devices have their own block size limitations. See the discussion of the
WRITE procedure call in the Guardian Procedure Errors and Messages Manual for
these limits.
Because the compiler cannot determine the block size of the device that is
ultimately associated with a file, you must choose the correct block size and record
size or risk getting a run-time error.
Blocking and Deblocking for Tape and Unstructured Disk
A BLOCK CONTAINS clause is effective (HP COBOL performs record blocking
and deblocking) only when all of these conditions are met, and the file associated
at open time is either a tape unit or an unstructured disk file:
°
The file’s organization is sequential.
°
The file has fixed-length records. This condition is met only when the file
description contains either no RECORD CONTAINS or RECORD VARYING
clause or contains a RECORD CONTAINS clause that specifies only a single
record size.
°
When the block size is specified in characters, it is a multiple of the number of
characters in the logical record size. Also, when a RECORD CONTAINS
clause extends the record size, the block size expressed is a multiple of the
number of characters in that specified record size.
°
The file is not described with a LINAGE or ALTERNATE RECORD KEY clause.