I have this code which will work even if the QTEMP/FILE1 is already existing.
CRTPF FILE(QTEMP/FILE1) RCDLEN(133)
MONMSG MSGID(CPF5813)
But when I put the same code inside SELECT...ENDSELECT, then the MONMSG can't handle the existing file and will have an error due to CPF5813.
SELECT
WHEN (&A *EQ &B) THEN(DO)
CRTPF FILE(QTEMP/FILE1) RCDLEN(133)
MONMSG MSGID(CPF5813)
... other codes
ENDDO
OTHERWISE (DO)
... other codes
ENDDO
ENDSELECT
How will I able to monitor the message inside SELECT statement?
Message
CPF5813is not the message to be monitored here, it is a diagnostic message. It is messageCPF7302which is raised byCRTPFand which must be monitored.If you want to check that
CPF5813is the diagnostic sent, you have to useRCVMSGlike below :