
Checking for invalid COBOL data or invalid COBOL programs
Use INITCHECK
and NUMCHECK
to
determine if your programs process invalid COBOL data at run time.
Use PARMCHECK
to determine if your programs have
mismatched parameters at run time that causes the corruption of data
beyond the end of WORKING-STORAGE
.
The INITCHECK
option checks for uninitialized
data items and issue warning messages when they are used without being
initialized.
NUMCHECK
option validates
the following data items when they are used as sending data items:NUMCHECK(ZON)
causes the compiler to generate code for an implicit numeric class test for zoned decimal (numericUSAGE DISPLAY
) data items that are used as sending data items in COBOL statements.NUMCHECK(PAC)
causes the compiler to generate code for an implicit numeric class test for packed decimal (COMP-3
) data items that are used as sending data items in COBOL statements.NUMCHECK(BIN)
causes the compiler to generate code similar toON SIZE ERROR
to test if binary data items contents are bigger than thePICTURE
clause. Note that this extra code will be generated only for binary data items that are used as sending data items, andCOMP-5
data items will not get thisON SIZE ERROR
code generated.
The PARMCHECK
option finds subprograms
that write beyond the end of WORKING-STORAGE
. This
option tells the compiler to generate an extra data item following
the last item in WORKING-STORAGE
that is then used
at run time to check whether a called subprogram corrupted data beyond
the end of WORKING-STORAGE
.
Performance
consideration:
PARMCHECK
and NUMCHECK
can
somewhat degrade performance because of the extra overhead to check
for invalid COBOL data. PARMCHECK
will cause the
compiler to generate slower code for programs with CALL
statements.
With PTF for APAR PH08642 installed, performance of NUMCHECK
has
been improved. However, performance is still best when using NONUMCHECK
,
and will be better at OPT(1)
and OPT(2)
than
at OPT(0)
.
