MONMSG's are all handled separately. If you have multiple monmsg's after a
command, each one of them is checked in order.
This is correct.
So the CPA09E was ignored
by the first monmsg because you don't have an EXEC. The second one then
checks it, and it qualifies, so it executes your code.
This is not correct.
It might be because Kevin mistyped CPA09E and didn't realize the ID was CPFA09E and is listed in both the MONMSG block and the info from the joblog.
The only reason the first MONMSG would be "ignored" would be if that message id (or one from the list) was not received as an escape message from the command.
A MONMSG without the EXEC section will "IGNORE" that escape message if the CL program receives it.
The program will then continue to the next command in the CL Program.
The program will not fall to the next MONMSG entry if the first one Omits the EXEC entry.
To repeat in case you missed it... The program will not fall to the next MONMSG entry if the first one (or any preceding MONMSG) Omits the EXEC entry.
From the Command Help of the EXEC parameter:
Specifies the CL command to be processed when a monitored message sent to the program's message queue meets the conditions specified in this command.
If no command is specified and a monitored message arrives on the queue, the message is ignored, and control passes to the next command in the program.
While the command itself can receive lots of messages, only an "Escape" message sent back to the CL from the command will be recognized in the MOMMSG block.
Without seeing the job log, and the call stack information for the messages that you are seeing, there isn't a real good way to troubleshoot that.
More likely the program received multiple errors as "info" messages, then one single Escape message from the SAV command.
Maybe something like
CPF3794 Save or restore operation ended unsuccessfully.
If your system as TAA Tools installed you can see the monitorable messages by using command
DSPMONMSG CMD(SAV)
Out of the message id's you have listed, only CPF3837 and CPF3838 are listed in the message id list from DSPMONMSG (on a V7R3 system).
CPF3837 &1 objects saved. &2 not saved.
CPF3838 &1 objects saved. &2 objects not saved.
The rest of the IDs you list are most likely Info or Diagnostic messages.
Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf
Of Kevin Bucknum
Sent: Monday, May 17, 2021 8:23 AM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: Re: Mult MONMSG not working as expected
As an Amazon Associate we earn from qualifying purchases.