5.2.4 BLOCK CONTAINS Clause
X >_Workstation_> Under AIX, OS/2, and Windows, the BLOCK CONTAINS clause is
X not supported for line sequential files. It is treated as a comment for
sequential, relative and indexed files. <_Workstation_<
The BLOCK CONTAINS clause specifies the size of the physical records. The
characters in the BLOCK CONTAINS clause reflect the number of bytes in the
X For example, if you have a block with 10 DBCS characters, the BLOCK
X 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
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 clause is syntax checked, but it 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 character positions and does not depend upon
whether the value was specified as CHARACTERS or as RECORDS.
Must be nonzero unsigned integers. They specify the number of:
Specifies the number of character positions required to store the
physical record, no matter what USAGE the characters have within
the data record.
If only integer-2 is specified, it specifies the exact character
size of the physical record. When integer-1 and integer-2 are
both specified, they represent, respectively, the minimum and
maximum character sizes of the physical record.
Integer-1 and integer-2 must include any control bytes and padding
contained in the physical record. (Logical records do not include
The CHARACTERS phrase is the default. CHARACTERS must be
- The physical record contains padding.
- Logical records are grouped so that an inaccurate physical
record size could be implied. For example, suppose you
describe a variable-length record of 100 characters, yet each
time you write a block of 4, one 50-character record is
written followed by three 100-character records. If the
RECORDS phrase were specified, the compiler would calculate
the block size as 420 characters instead of the actual size,
370 characters. (This calculation includes block and record
Specifies the number of logical records contained in each physical
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.
X When running under OS/390, BLOCK CONTAINS 0 can be specified for QSAM
X files; the block size is determined at run time from the DD parameters or
X the data set label.
X If the RECORD CONTAINS 0 CHARACTERS clause is specified, and the BLOCK
X CONTAINS 0 CHARACTERS clause is specified (or omitted), the block size is
X determined at run time from the DD parameters or the data set label of the
X file. For output data sets, with either of the above conditions, the DCB
X used by Language Environment will have a zero block size value. If you do
X not specify a block size value, the operating system might select a System
X Determined Block Size (SDB). See the operating system specifications for
X further information on SDB.
X BLOCK CONTAINS can be omitted for SYSIN/SYSOUT files under OS/390. The
X blocking is determined by the operating system.
X When running under CMS, BLOCK CONTAINS 0 can be specified for QSAM files;
X the block size is determined at run time from the FILEDEF parameters or
X the data set label. If the RECORD CONTAINS 0 CHARACTERS clause is
X specified, and the BLOCK CONTAINS clause is omitted (or if the BLOCK
X CONTAINS 0 CHARACTERS clause is specified), the block size is determined
X at run time from the FILEDEF parameters or the data set label of the file.
X Under VM, the BLOCK CONTAINS 0 clause might cause blocked or unblocked
X records to be used for an output file, depending on the FILEDEF options
X specified. The DCB used by Language Environment will have a zero block
X size, so the FILEDEF uses the CMS defaults. The defaults are documented
X in the CMS Command Reference, under the FILEDEF command.
X The BLOCK CONTAINS clause is treated as a comment under an SD.
X The BLOCK CONTAINS clause cannot be used with the RECORDING MODE U clause.
© Copyright IBM Corp. 1991, 1998
IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.
Return to library:
IBM Hardware |
IBM System z Redbooks
How to order publications
Download IBM Library Reader |
Download IBM Softcopy Reader |
Download Adobe® Acrobat® Reader®
Download IBM Softcopy Librarian
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks
of Adobe Systems incorporated.