On 29 Jan 2013 12:27, Stone, Joel wrote:
I have the following code at the top of CL:
MONMSG MSGID(CPF2103 CPF2104 CPF2105 CPF4520 +
CPF1023 CPF2110 CPF2111 CPA7025 CPF2125 CPF7030)
MONMSG MSGID(CPF9999) EXEC(GOTO CMDLBL(ABENDPGM))
...
...
ABENDPGM:
RCVMSG MSGTYPE(*EXCP) MSG(&ERRMSG) MSGID(&RTNCODE)
When I RCVMSG, the &ERRMSG is always CPF9999
How do I RCVMSG after the MONMSG GOTO and get a useful msg (the msg
PRIOR TO CPF9999)
The message identifier that was origin for the CPF9999 is in the &1
of the message data. The program name and other information is
elsewhere in the message data as well.
Regardless, just code the same RCVMSG MSGTYPE(*EXCP) a second time to
get the prior exception\escape message; though since the CPF9999 is
being disposed of, probably drop the MSG() and MSGID() on the first
invocation.