Hello,
I have a CL program with MONMSG monitoring for CPF errors. It is an interactive program with a DSPF. I would like to retrieve the error message so I can show it to the user if an error occurs. What's the easiest way?
I've tried using RTVMSG inside my MONMSG, but it requires me to have the MSGID. So I've tried retrieving the MSGID by using a RCVMSG, but I never seem to be able to retrieve the correct MSGID. There must be an easier way to do this, right? Is there no way to store/retrieve the MSGID that is captured by the MONMSG?
Basically, my code is this :
Since I'm intercepting all CPF errors, I simply want to show what error is intercepted. The program is destined to be used only by other developers, so there is no need to remove technical jargon from the message.
Thanks !
I have a CL program with MONMSG monitoring for CPF errors. It is an interactive program with a DSPF. I would like to retrieve the error message so I can show it to the user if an error occurs. What's the easiest way?
I've tried using RTVMSG inside my MONMSG, but it requires me to have the MSGID. So I've tried retrieving the MSGID by using a RCVMSG, but I never seem to be able to retrieve the correct MSGID. There must be an easier way to do this, right? Is there no way to store/retrieve the MSGID that is captured by the MONMSG?
Basically, my code is this :
Code:
CALL QCMDEXC PARM(&CMD 2000) MONMSG MSGID(CPF0000) EXEC(DO) RCVMSG MSGID(&MSGID) RTVMSG MSGID(&MSGID) MSGF(QCPFMSG) MSG(&MSG) CHGVAR VAR(&W2MSG) VALUE(&MSG) SNDRCVF RCDFMT(WIN2) GOTO TF1 ENDDO
Thanks !
Comment