The BLOCK CONTAINS clause specifies the size of the physical records.
The CHARACTERS phrase indicates that the integer specified in the BLOCK CONTAINS clause reflects the number of bytes in the record. For example, if you have a block with 10 DBCS characters or 10 national characters, the BLOCK CONTAINS clause should say BLOCK CONTAINS 20 CHARACTERS.
If the records in the file are not blocked, the BLOCK CONTAINS clause can be omitted. When it is omitted, the compiler assumes that records are not blocked. Even if each physical record contains only one complete logical record, coding BLOCK CONTAINS 1 RECORD would result in fixed blocked records.
The BLOCK CONTAINS clause can be omitted when the associated file-control entry specifies a VSAM file. The concept of blocking has no meaning for VSAM files. The BLOCK CONTAINS clause is syntax checked but has no effect on the execution of the program.
For external files, the value of all BLOCK CONTAINS clauses of corresponding external files must match within the run unit. This conformance is in terms of bytes and does not depend upon whether the value was specified as CHARACTERS or as RECORDS.
If only integer-2 is specified, it specifies the exact number of bytes in the physical record. When integer-1 and integer-2 are both specified, they represent the minimum and maximum number of bytes in the physical record, respectively.
integer-1 and integer-2 must include any control bytes and padding contained in the physical record. (Logical records do not include padding.)
The CHARACTERS phrase is the default. CHARACTERS must be specified when:
The compiler assumes that the block size must provide for integer-2 records of maximum size, and provides any additional space needed for control bytes.
BLOCK CONTAINS 0 can be specified for QSAM files. If BLOCK CONTAINS 0 is specified for a QSAM file, then:
BLOCK CONTAINS can be omitted for SYSIN files and for SYSOUT files. The blocking is determined by the operating system.
The BLOCK CONTAINS clause is syntax checked but has no effect on the execution of the program when specified under an SD.
The BLOCK CONTAINS clause cannot be used with the RECORDING MODE U clause.