Replying to Run-Time Inquiry Messages

When you run a program with ILE RPG procedures, run-time inquiry messages may be generated. They occur when the default error handler is invoked for a function check in a cycle-main procedure. See Exception Handling within a Cycle-Main Procedure. The inquiry messages require a response before the program continues running.
Note: Inquiry messages are never issued for subprocedures (including those designated as linear-main procedures), since the default error handling for a function check in a subprocedure causes the subprocedure to be cancelled, causing the exception to percolate to the caller of the subprocedure. See Exception Handling within Subprocedures.

If the caller of the subprocedure is an RPG procedure, the call will fail with status 00202, independent of the status code associated with the actual exception. If the failed call causes an RPG cycle-main procedure to invoke its default handler, inquiry message RNQ0202 will be issued.

You can add the inquiry messages to a system reply list to provide automatic replies to the messages. The replies for these messages may be specified individually or generally. This method of replying to inquiry messages is especially suitable for batch programs, which would otherwise require an operator to issue replies.

Start of change To find all the ILE RPG inquiry messages you can add to the system reply list, use the following command:
DSPMSGD RANGE(RNQ0100 RNQ9999)
        MSGF(QRNXMSG) DETAIL(*BASIC) OUTPUT(*PRINT)
Note: ILE RPG inquiry messages have a message id prefix of RNQ.
End of change
To add inquiry messages to a system reply list using the Add Reply List Entry command enter:
ADDRPYLE sequence-no message-id

where sequence-no is a number from 1-9999, which reflects where in the list the entry is being added, and message-id is the message number you want to add. Repeat this command for each message you want to add.

Use the Change Job (CHGJOB) command (or other CL job command) to indicate that your job uses the reply list for inquiry messages. To do this, you should specify *SYSRPYL for the Inquiry Message Reply (INQMSGRPY) attribute.

The reply list is only used when an inquiry message is sent by a job that has the Inquiry Message Reply (INQMSGRPY) attribute specified as INQMSGRPY(*SYSRPYL). The INQMSGRPY parameter occurs on the following CL commands:
  • Change Job (CHGJOB)
  • Change Job Description (CHGJOBD)
  • Create Job Description (CRTJOBD)
  • Submit Job (SBMJOB).

You can also use the Work with Reply List Entry (WRKRPYLE) command to change or remove entries in the system reply list. For details of the ADDRPYLE and WRKRPYLE commands, see the CL and APIs section of the Programming category in the IBM® i Information Center at this Web site - http://www.ibm.com/systems/i/infocenter/.