Start of change


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.

PARMCHECK is introduced in Enterprise COBOL V6.1 with the PTF for APAR PI78089 installed.

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.

PARMCHECK option syntax

Read syntax diagramSkip visual syntax diagramNOPARMCHECKPARMCHECK(MSGABD, n)


Abbreviations are: NOPC|PC

Suboption defaults are:
  • If no suboption is specified, default is PARMCHECK(MSG,100).
  • If only MSG or ABD is specified, default is PARMCHECK(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).
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 the CALL statement, and the program name is issued. Start of changeAlso, this check is done after the affected CALL statement is executed. End of change
  • If ABD is in effect, a similar message is issued, but with a terminating level that causes an abend.

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.

related references  
CALL statement (Enterprise COBOL for z/OS® Language Reference)

End of change