You should consider the following things when using the CHECK function.
Always use the CHECK function and correct abnormalities based on the detected information. If a detected abnormality is not corrected, serious trouble that can be difficult to detect, such as memory destruction, can occur at execution. The results of executing applications for which detected abnormalities have not been corrected will be unpredictable.
Execution can be continued after an abnormality is detected by specifying a message output count, however, operation after detection of an abnormality cannot be guaranteed.
The CHECK function performs processing other than the processing described in the COBOL program such as checking data. Therefore, the program size increases and execution speed deteriorates when the CHECK function is used.
Use the CHECK function during debugging only. When debugging is completed, recompile the program with compiler option NOCHECK specified.
In arithmetic statements with an ON SIZE ERROR or NOT ON SIZE ERROR phrase, CHECK(NUMERIC) does not check for a zero divisor as the COBOL code already handles that situation.
If zero-divisor checking is performed, the program terminates abnormally, regardless of the specification of the message output count.
For a CHECK (LINKAGE) check, the following phenomenon will occur if the output count has been specified and execution is continued after an abnormality was detected:
If an abnormality was detected for a lower level call for a deep call hierarchy, a message will also be output for the upper level call as well as for the call for which the abnormality was detected. If the upper level call is normal, message output will be stopped only by correcting the lowest level call.
CHECK(PRM) does not affect the program size or execution speed at the time of compilation.
CHECK(PRM) does not investigate CALL statements that specify identifiers as program names.
CHECK(PRM) does not perform an investigation when an internal program is called by a CALL statement in which the program name is specified in an identifier.
Both of the calling and called programs must be compiled with the NetCOBOL compiler V8.0L10 or later with the CHECK(PRM) option in order to check parameters for calling external programs. A parameter check is not exercised if a program calls a program written in another language or is called by a program written in another language.
In a CHECK(PRM) investigation for calling an external program an error is not always found if the difference in the number of calling and called parameters is more than 3.
In the checks performed when CHECK(PRM) is specified, the parameter length of a variable-length item is the maximum length, not the length at the time of execution. Therefore, for a variable-length item, a message may be output even if the parameter lengths actually match.
CHECK(PRM) will check parameters for calls made using the COBOL and C calling conventions. The parameter check is not performed for the STDCALL calling convention.
Refer to "Differences Among Calling conventions" in the "NetCOBOL User's Guide" for details of the calling conventions.
If a calling or called program does not specify a RETURNING phrase, the PROGRAM-STATUS is passed implicitly. Therefore the CHECK(PRM) checks will find a 4-byte RETURNING parameter in these situations where the RETURNING phrase is omitted.
The CHECK function is effective only in programs that specify the CHECK option. When two or more programs are linked, only specify the CHECK option in the programs that you want to target.