If the preprocessor or the compiler detects an error, or the possibility of an error, messages are generated. Messages generated by the preprocessor appear in the listing immediately after the listing of the statements processed by the preprocessor. You can generate your own messages in the preprocessing stage by use of the %NOTE statement. Such messages might be used to show how many times a particular replacement had been made. Messages generated by the compiler appear at the end of the listing.
For compilations that produce no messages, the compiler will include a line saying "no compiler messages" where the compiler messages would have been listed.
Messages are displayed in the following format:
PPPnnnnI X
where PPP is the prefix identifying the origin of the message (for example, IBM indicates the PL/I compiler), nnnn is the 4-digit message number, and X identifies the severity code. All messages are graded according to their severity, and the severity codes are I, W, E, S, and U.
For every compilation job or job step, the compiler generates a return code that indicates to the operating system the degree of success or failure it achieved. For z/OS, this code appears in the end-of-step message that follows the listing of the job control statements and job scheduler messages for each step.
Table 5 provides an explanation of the severity codes and the comparable return code for each:
|
Severity Code |
Return Code |
Message Type |
Description |
|---|---|---|---|
|
I |
0000 |
Informational |
The compiled program should run correctly. The compiler might inform you of a possible inefficiency in your code or some other condition of interest. |
|
W |
0004 |
Warning |
A statement might be in error (warning) even though it is syntactically valid. The compiled program should run correctly, but it might produce different results than expected or be significantly inefficient. |
|
E |
0008 |
Error |
A simple error fixed by the compiler. The compiled program should run correctly, but it might product different results than expected. |
|
S |
0012 |
Severe |
An error not fixed by the compiler. If the program is compiled and an object module is produced, it should not be used. |
|
U |
0016 |
Unrecoverable |
An error that forces termination of the compilation. An object module is not successfully created. |
|
Note:
Compiler
messages are printed in groups according to these severity levels. |
|||
The compiler lists only messages that have a severity equal to or greater than that specified by the FLAG option, as shown in Table 6.
| Type of Message | Option |
|---|---|
| Information | FLAG(I) |
| Warning | FLAG(W) |
| Error | FLAG(E) |
| Severe Error | FLAG(S) |
| Unrecoverable Error | Always listed |
The text of each message, an explanation, and any recommended programmer response, are given in Enterprise PL/I Messages and Codes.