DB2 graphic  QMF Version 8

Using messages with the REXX EXIT instruction

You can use the REXX EXIT instruction to exit a procedure with logic. QMF always issues a message when it finishes running a procedure with logic. If you use the EXIT instruction, the message you see depends on these factors:

Table 11 shows which message you see based on the given conditions.

Table 11. Messages returned from QMF commands in procedures
Nonzero return code from the last QMF command Procedure return code Message at completion of procedure
No 0 OK, your procedure was run
No nonzero The return code from your procedure was 8
Yes 0 The error message provided by QMF
Yes nonzero The error message provided by QMF

An error message takes precedence over the return code message if you have an incorrect QMF command and a nonzero return code.

If you want to show the error message from the last command and exit with a nonzero return code, use the MESSAGE command as in Figure 163.

Figure 163. Specify MESSAGE to see the error message from the last command.
"MESSAGE (TEXT='"dsq_message_text"'"
exit rc

The variable dsq_message_text is a QMF-provided REXX variable. You can use the MESSAGE command and the dsq_message_text variable to store and display a message after further processing has occurred, as shown in Figure 164.

Figure 164. The MESSAGE command displays the original error message.
 /* Monthly report                                           */
   Signal on error
   "DISPLAY TABLE JUNE_INFO"
   "PRINT REPORT"
   Exit(0);
 Error:
   Original_msg = dsq_message_text    /* Saves error message. */
   "RUN PROC GENERAL_RECOVERY"        /* This proc generates  */
                                      /* new dsq_message_text. */
   "MESSAGE (TEXT='" Original_msg "'" /* Display original error msg. */
   Exit(8);

For more information on the MESSAGE command, see DB2 QMF Reference.


Go to the previous page Go to the next page

Downloads | Library | Support | Support Policy | Terms of use | Feedback
Copyright IBM Corporation 1982,2004 Copyright IBM Corporation 1982, 2004
timestamp Last updated: March, 2004