MONMSG and SNDRPY

45 pts.
Tags:
Application development
CLP
RPG
RPG ILE
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,

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following