45 pts.
 MONMSG and SNDRPY
Dear, I'm trying to write a small program to run my backup job via BRMS... and I would like to check the different errors and reply automatically to few of them. Ok, I can monitor the error messages through MONMSG but how can I reply to them ? I know that I have to use SNDRPY but how can I have the Message Key??? Here is a short part of one of my tries: START: STRBKUBRM ... MONMSG MSGID(BRM1033) EXEC(GOTO CMDLBL(RESTART)) MONMSG MSGID(BRM0000) EXEC(GOTO CMDLBL(ERROR)) GOTO END RESTART: RCVMSG MSGTYPE(*LAST) KEYVAR(&MSGKY) SNDRPY MSGKEY(&MSGKY) MSGQ(QSYSOPR) RPY('C') GOTO START ERROR: ... END: ... When running this code, here is the error that I have: CPF2410: Message key not found in message queue QSYSOPR. Perhaps, I need to specify in the RCVMSG the MSGQ: MSGQ(QSYSOPR) ? If yes... OK, it'll work... but what about if the configured BRMS send all its messages to another MSGQ ? I've an other question... How can we make sure that the message received by the command RCVMSG MSGTYPE(*LAST) will be only the message BRM1033. Thanks for your help,

Software/Hardware used:
ASKED: November 2, 2006  3:00 AM
UPDATED: December 25, 2009  2:20 AM

Answer Wiki:
Why don't you use the System reply List (WRKRPYL). Specify BRM1033 with a reply value set to 'C'. Don't forget to modify your JOBD parameter INQMSGRPY to *SYSRPYL. ============================================================ I'm not aware of <b>any</b> message that can be monitored for and that will also accept a reply. You monitor for *ESCAPE, *STATUS or *NOTIFY messages. But you would reply only to *INQ (inquiry) messages. Further, you monitor for messages that appear on the program's message queue. But your SNDRPY command is trying to send a reply to the QSYSOPR user message queue. A MONMSG wouldn't be appropriate. The condition has been signaled and the STRBKUBRM command has ended at the time your MONMSG receives control. The system reply list is possibly a good alrenative for what you've shown. If you could explain your actual business problem, a more precise and appropriate solution is probably available. Tom
Last Wiki Answer Submitted:  December 25, 2009  2:20 am  by  Addisonm   0 pts.
All Answer Wiki Contributors:  Addisonm   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _