This option specifies whether to use the CHECK function (CHECK) or not (NOCHECK). An integer ranging from 0 to 999999 is specified for n as the number of messages to be displayed. If the option is omitted, 1 is assumed to be specified.
Item | Description | |
---|---|---|
Check function | Specifies whether the CHECK function can be used. The default is NOCHECK. | |
CHECK | Uses the CHECK function. | |
NOCHECK | Does not use the CHECK function. | |
Number of messages to be displayed | Specifies the number of messages to be displayed. | |
Check items | ||
ALL | Checks all of NUMERIC, BOUND, ICONF, LINKAGE, and PRM. | |
BOUND | Checks whether subscripts, indexes, and reference modifications are in their correct ranges. | |
ICONF | Checks whether the INVOKE statement parameters are compatible with the tentative parameters of the method to be called. | |
NUMERIC | Checks for a data exception. If a numeric item contains a value that does not match its attribute, or if the divisor of division operation is 0, a data exception occurs. | |
PRM | Checks the following during compilation related to data items described in the USING or RETURNING phrases of the CALL statement (except call identifiers) invoking internal programs, and the USING or RETURNING phrase of the internal programs:
A check of the following is performed during execution related to data items described in both the USING or RETURNING phrase of the CALL statement invoking external programs, and the USING or RETURNING phrase of the external programs:
Note: If the USING phrases have four or more parameter number mismatch errors, an error may not be detected.
|
Note
While the CHECK function is enabled, the program continues running until the n-th message is output. However, the program may not run as expected due to destruction of an area or other issue. If 0 is specified for n, the program continues running regardless of the number of messages that have been displayed.
If CHECK is specified, processing for the checks described above is embedded in an object program, decreasing execution performance. After debugging, recompile the program with NOCHECK specified.
A check for a zero divisor for ON SIZE ERROR is performed on an arithmetic statement with the ON SIZE ERROR or NOT ON SIZE ERROR phrase. However, this divisor check is not performed on CHECK (NUMERIC).
A check for a data exception on CHECK (NUMERIC) is performed only if zoned decimal items or packed decimal items are referenced, or alphanumeric data items or group items are moved to zoned decimal items or packed decimal items. However, the following are not checked:
Table element for which ALL is specified as a subscript
Key items in the SEARCH ALL statement, except in cases where the subscripts for the key items are one-dimensional and a single WHEN condition is specified
Key items for the SORT/MERGE statement
Host variables used in SQL statements
BY REFERENCE parameter of the CALL statement, the INVOKE statement, and an in-line invocation
Arguments of the following intrinsic functions:
FUNCTION ADDR
FUNCTION LENG
FUNCTION LENGTH
Moving of alphanumeric data items or group data items to object properties of zoned decimal items or packed decimal items.