BLOCK0
Use BLOCK0
to change the compiler default
for QSAM files from unblocked to blocked (as if BLOCK CONTAINS
0
were specified) and thus gain the benefit of system-determined
blocking for output files.
Default is: NOBLOCK0
Abbreviations are: None
BLOCK0
activates an
implicit BLOCK CONTAINS 0
clause for each file in
the program that meets the following three criteria: - The
FILE-CONTROL
paragraph either specifiesORGANIZATION SEQUENTIAL
or omits theORGANIZATION
clause. - The
FD
entry does not specifyRECORDING MODE U
. - The
FD
entry does not specify aBLOCK CONTAINS
clause.
Files for which the resulting BLOCK CONTAINS 0
clause
is in effect have a blocking factor that is determined at run time
from the data definition or from the data-set characteristics.
Interaction
of the APPLY WRITE-ONLY
clause and the AWO
compiler
option with BLOCK0
:
- If
NOBLOCK0
is in effect, and the file description of a file that meets the three criteria listed above specifiesAPPLY WRITE-ONLY
, the compiler issues an error message becauseAPPLY WRITE-ONLY
applies only to blocked files. But ifBLOCK0
is in effect, the result is that the file is blocked, and theAPPLY WRITE-ONLY
clause is therefore accepted. AWO
applies to any QSAM files that have blocked variable-length records. IfBLOCK0
is in effect, the result is that more files might be blocked than ifNOBLOCK0
were in effect; thusAWO
might apply to more files than it otherwise would.
Specifying BLOCK0
for existing programs
might result in a change of behavior, and in some cases produce undesirable
results for files opened as INPUT
. For example:
- The
OPEN INPUT
statement fails for files for which no block size can be determined. - Programs that continue after handling nonzero
FILE STATUS
codes for files opened asINPUT
might abnormally terminate when executing subsequent I/O statements on those files.
For
these reasons, after compiling with BLOCK0
you should
investigate and test the effects on your program.
For recommendations
about blocking, see the related reference from the Enterprise COBOL for z/OS® Migration Guide (in the information
about migrating from CMPR2
to NOCMPR2
).
AWO
APPLY WRITE-ONLY clause (Enterprise COBOL for z/OS Language Reference)
BLOCK CONTAINS clause (Enterprise COBOL for z/OS Language Reference)
Enterprise COBOL for z/OS Migration Guide
(Recommendation for DCB= parameters of JCL)