COBOL runtime messages are written in the format:
date-and-time message-number [process-id thread-id] message-text
Date-and-time
The date and time are displayed in the format:
YYYY-MM-DD HH:MM:SS (Year-Month-Day Hour:Minute:Second)
The time is displayed in local time.
Message-number
The message number is displayed in the format:
JMPnnnni-w
JMP : Prefix indicates a runtime system message.
nnnn : Message serial number.
i : Characters to indicate severity and response required.
I : Operator response is unnecessary.
A : Operator response is necessary.
w : Severity code.
The relationship between the severity code and return code is shown in table below.
If a COBOL program is directly executed from a batch file, the return code (PROGRAM-STATUS) of the COBOL program is reflected to ERRORLEVEL immediately after execution of the COBOL program in the batch file. For how to use ERRORLEVEL, refer to the manual or on-line help of each system.
Severity Code | Level | Meaning | Effect on Return Code |
---|---|---|---|
I (INFORMATION) | Transmitting message | Information detected by the runtime system. The program can be executed normally. | Not affected |
W (WARNING) | Warning error | The program can be | Not affected |
E (ERROR) | Recoverable error | There is an error, but processing is continued according to the appropriate assumption. | Affected (*1) |
U (UNRECOVERABLE) | Unrecoverable error | The system stops program execution and performs termination processing. | Affected (*2) (*3) |
*1 : If an E-level message output, a return code is set when the COBOL execution unit terminates. The E-level message return code is assumed to be 12. It is compared to the value in special register PROGRAM-STATUS, and the larger value is set as the return code.
*2 : If a U-level message is output, the program terminates abnormally. In this case, 255 is set as the return code. When the COBOL program is forced to terminate, 255 is also set as the return code.
*3 : When a U Level message is displayed, set the COBOL Error Report to runs automatically so that the COBOL Error Report can detect errors and display a diagnostic report. Refer to "Using the COBOL Error Report" in Chapter 2 of the "NetCOBOL Debugging Guide".
Process ID and Thread ID
The process ID and thread ID of the program in which an error is detected are indicated in the following format:
[PID:mmmmmmmm TID:nnnnnnnn]
mmmmmmmm : Process ID of the application in which an error is detected
nnnnnnnn : Thread ID of the application in which an error is detected