MIDRANGE dot COM Mailing List Archive



MIDRANGE-L » January 2013

Re: how to RCVMSG and NOT get CPF9999



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.






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2013 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact