NUMCHECK
The NUMCHECK compiler
option tells the compiler whether to generate extra code to validate
data items when they are used as sending data items. For zoned decimal
(numeric USAGE DISPLAY) and packed decimal (COMP-3)
data items, the compiler generates implicit numeric class tests for
each sending field. For binary data items, the compiler generates SIZE
ERROR checking to see whether the data item has more digits
than its PICTURE clause allows.
Default is: NONUMCHECK
Suboption defaults are:
If no suboption is specified, defaults are ZON(ALPHNUM), PAC, BIN and MSG. For example,NUMCHECKhas the same effect asNUMCHECK(ZON(ALPHNUM),PAC,BIN,MSG).
If no datatype suboption is specified, default datatype
suboptions are ZON(ALPHNUM), PAC, and BIN. For example,NUMCHECK(ABD)shas the same effect asNUMCHECK(ZON(ALPHNUM),PAC,BIN,ABD).
If only one datatype suboption is specified, defaults
are NOZON,NOPAC,NOBIN, andMSG. For example,NUMCHECK(BIN)has the same effect asNUMCHECK(NOZON,NOPAC,BIN,MSG).
If all datatype suboptions are specified with NO, then the listing will showNONUMCHECK. For example,NUMCHECK(NOZON,NOPAC,NOBIN)has the same effect asNONUMCHECK.

Abbreviations are: NONC | NC
ZON [(ALPHNUM | NOALPHNUM)] | NOZON
Specifying
ZONorcauses the compiler to generate code for an implicit numeric class test for zoned decimal (numeric
ZON(ALPHNUM)
USAGE DISPLAY) data items that are used as sending data items in COBOL statements.
Specifying ZON(NOALPHNUM)causes the compiler to generate code for an implicit numeric class test for zoned decimal (numeric USAGE DISPLAY) data items that are used as sending data items in COBOL statements, except when they are used in a comparison with an alphanumeric data item, alphanumeric literal or alphanumeric figurative constant.
Receivers are not checked, unless they are both a sender and a receiver, such as data item B in the following sample statements:
ADD A TO BDIVIDE A INTO BCOMPUTE B = A + BINITIALIZE B REPLACING ALPHANUMERIC BY BThis checking is done before the data is used in each statement:- If the data is
NOT NUMERIC, either a warning message forNUMCHECK(ZON,MSG)or a terminating message forNUMCHECK(ZON,ABD)is issued. - If the data is
NUMERIC, the external behavior of the statement is the same asNUMCHECK(NOZON), other than being slower.
- If the data is
PAC | NOPACSpecifying
PACcauses 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.
For packed decimal data items that have an even number
of digits, the unused bits are checked for ones.
Restriction:
For CALLstatements,NUMCHECK(ZON)andNUMCHECK(PAC)checkBY CONTENTdata items that are zoned decimal or packed decimal, but they do not checkBY REFERENCEparameters. (Neither zoned decimal nor packed decimal data items can be specified in aBY VALUEphrase.)
BIN | NOBIN- Specifying
BINcauses the compiler to generate code similar toON SIZE ERRORto test if binary data items contents are bigger than thePICTUREclause. This extra code will be generated only for binary data items that are used as sending data items, andCOMP-5data items will not get thisON SIZE ERRORcode generated. MSG | ABD- Determines whether the message issued for invalid data is a warning
level message to continue processing or a terminating level message
to cause an abend:
- If
MSGis in effect, a runtime warning message with the line number, data item name, data item content, and program name is issued.
Also, the affected statements
will still be executed. 
- If
ABDis in effect, a terminating message is issued that causes an abend.
- If
Performance considerations: NUMCHECK is
much slower than NONUMCHECK, depending on how many
zoned decimal (numeric USAGE DISPLAY) data items, packed decimal (COMP-3)
data items, and binary data items are used in a COBOL program.
In Enterprise COBOL V6.1 with PTF for
APAR PI71625 installed, ZONECHECK is deprecated but
is tolerated for compatibility, and it is replaced by
NUMCHECK(ZON(ALPHNUM))
. 

