The Resend Last Message command resends the last message received
from your program message queue to your calling program. If an
escape message is received, you may optionally resend a prior
diagnostic message if it exists.
A typical sequence of commands would be:
SBMJOB JOB(xxx) ...
The RSNLSTMSG command would receive the completion message sent to
your programs message queue and resend it to the program that called
your program. If you had called the program from a command entry
display, the message would appear as a message. The message is
removed from your program message queue.
RSNLSTMSG may only be used in a CL program. By default, the same
type of message received is resent. An option exists to resend the
same message as a different type. For example, you may receive an
*ESCAPE type and resend it as a *DIAG type. Or you may receive a
*COMP type and resend it as an *INFO type.
Note that if you received an escape message and resend it using the
default, your program will end. Your program will also end if you
receive any type of message and resend it with MSGTYPE(*ESCAPE).
RSNLSTMSG accesses only the last message received and it must be one
of the following message types:
15 Escape message
If an escape message is to be resent, you must first monitor for the
message such as:
CRTDTAARA DTAARA(xxx) ...
MONMSG MSGID(CPF0000) EXEC(DO) /* Some error */
ENDDO /* Some error */
If you want to resend either the escape or completion message from a
command such as CRTDTAARA, you would do the following:
CRTDTAARA DTAARA(xxx) ...
MONMSG MSGID(CPF0000) /* Ignore any error */
If the message is sent with a message ID, it is resent using the same
message ID and message file.
If the message was sent without using a Message ID, CPF9898 is used
in QCPFMSG and the text of the message is resent as the message data.
Some commands may send diagnostic messages and then a general escape
message. If RSNLSTMSG is used, only the escape message would be
The CPP uses RCVMSG with PGMQ(*PRV) and MSGTYPE(*LAST) to access the
message. The QMHSNDPM API is used to send the message to the program
above your program on the program stack.
Differences with RSNALLMSG
RSNLSTMSG resends only the last message received. RSNALLMSG resends
all messages that exist in the current programs message queue.
Command parameters *CMD
MSGTYPE The message type to send. The default is *SAME
meaning the same type of message that is received is
You may specify that the message type received be
resent as *INFO, *COMP, *DIAG, or *ESCAPE.
DIAG If an *EXCP is received, whether to resend the
previous diagnostic message if it exists. *NO is
the default meaning the previous diagnostic remains
in the program message queue.
*YES may be specified to resend the diagnostic
message if it exists. The message is first removed
from the job log and then resent.
See the previous list of message types supported.
The following TAA Tools must be on your system:
SNDESCMSG Send escape message
None, the tool is ready to use.
Objects used by the tool
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
TAAMSHG *CMD TAAMSHG QATTCMD
TAAMSHGC *PGM CLP TAAMSHGC QATTCL