Processing of MSGEXIT

The MSGEXIT module is used to customize compiler diagnostic messages and FIPS messages. The module can customize a message either by changing its severity or suppressing it.

If the MSGEXIT module assigns a severity to a FIPS message, the message is converted into a diagnostic message. (The message is shown in the summary of diagnostic messages in the listing.)

A MSGEXIT summary at the end of the compiler listing shows how many messages were changed in severity and how many messages were suppressed.

Table 1. MSGEXIT processing
Action by compiler Action by exit module
Loads the exit module (mod5) during initialization  
Calls the exit module with an OPEN operation code (op code) Optionally processes str5 and passes the status of the OPEN request to the compiler
Calls the exit module with a MSGSEV operation code (op code) when the compiler is about to issue a diagnostic message or FIPS message One of the following actions:
  • Indicates no customization of the message (by setting return code to 0)
  • Specifies a new severity for (or suppression of) the message, and sets return code to 4
  • Indicates that the operation failed (by setting return code to 12)
Calls the exit module with a CLOSE op code Optionally frees storage and passes the status of the CLOSE request to the compiler
Deletes the exit module (mod5) during compiler termination  

MSGEXIT parameters

The compiler uses 10 parameters, passed by reference, to communicate with the exit module. The return code and user-requested severity parameters are set by the exit module for return to the compiler; the other items are passed from the compiler to the exit module.

Table 2. MSGEXIT parameters
Parameter number Parameter item Description of item
1 User-exit type Halfword that identifies which user exit is to perform the operation.

6=MSGEXIT

2 Operation code Halfword that indicates the type of operation:
  • 0=OPEN
  • 1=CLOSE
  • 5=MSGSEV: customize message severity
3 Return code Fullword, set by the exit module, that indicates the success of the requested operation.
For op code MSGSEV:
  • 0=Message not customized
  • 4=Message found and customized
  • 12=Operation failed
4 User-exit work area Six-fullword work area provided by the compiler for use by the user-exit module.

Sixth word: for use by MSGEXIT

5 Not used (Used by the other exits)
6 Message exit data Three-halfword area (on a halfword boundary).
  • First halfword: the message number of the message to be customized
  • Second halfword: for a diagnostic message, the default severity; for a FIPS message, the FIPS category as a numeric code
  • Third halfword: the user-requested severity for the message (-1 to indicate suppression)
7 str5 First halfword (on a halfword boundary): the length of the string, followed by the string
8 Not used (Used only by LIBEXIT)
9 Not used (Used only by LIBEXIT)
10 Not used (Used only by LIBEXIT)

Example: MSGEXIT user exit