PARMCHECK
The PARMCHECK
option
tells the compiler to generate an extra data item following the last
item in WORKING-STORAGE
. This buffer data item is
then used at run time to check whether a called subprogram corrupted
data beyond the end of WORKING-STORAGE
.
When a calling
program is compiled with PARMCHECK
, the compiler
generates a buffer following the last data item in the WORKING-STORAGE
section.
At run time, before each call, the buffer is set to ALL x'AA'. After
each call, the buffer is checked to see whether it was changed. The PARMCHECK
option
can help with your migration from COBOL V4 and earlier compilers to
COBOL V6 and later compilers, and can also be used to clean up and
check for good programming practices.
Default is: NOPARMCHECK
Abbreviations
are: NOPC
| PC
- If no suboption is specified, default is
PARMCHECK(MSG,100)
. - If only
MSG
orABD
is specified, default isPARMCHECK(MSG | ABD,100)
. For example,PC(ABD)
=PC(ABD,100)
. - If only n is specified, default is
PARMCHECK(MSG,n)
. For example,PC(5000)
=PC(MSG,5000)
.
MSG | ABD
- Determines whether the message issued for subprogram corruption of data is a warning level message to continue processing or a terminating level message to cause an abend:
- If
MSG
is in effect, a runtime warning message with the name of the parameter, the line number of theCALL
statement, and the program name is issued. Also, this check is done after the affectedCALL
statement is executed. - If
ABD
is in effect, a similar message is issued, but with a terminating level that causes an abend.
- If
- n
The size in bytes of the buffer to be added after the last item in
WORKING-STORAGE
. Must be an integer in the range of 1 to 9999.
Performance
considerations: PARMCHECK
will cause the compiler
to generate slower code for programs with CALL
statements. NOPARMCHECK
should
be in effect for good performance.