|
On Wed, 18 Dec 2019 at 04:27, techie21 IT <techiei876@xxxxxxxxx> wrote:
For this I tried below code :-The general approach seems fine, so that means the implementation is the issue.
PGM
MONMSG MSGID(CPF0000) EXEC(GOTO ERROR)
CALL PGM1
CALL PGM2
RETURN
ERROR:
SNDPGMMSG MSGID(CPF9898) MSGF(QSYS/QCPFMSG) +
MSGDTA('Unexpected errors detected, see +
messages in job log') TOPGMQ(*PRV *) +
TOMSGQ(*TOPGMQ) MSGTYPE(*ESCAPE)
ENDPGM
but it is unnecessarily itrying to execute PGM2 whereas it did not bother
whether there were some errors found in PGM1 itself why is it happening
like this
In PGM1, how are the errors 'thrown'?
If they are not *ESCAPE messages, the MONMSG in the CLP will not be
asserted and execution will continue.
Perhaps the 'error messages' are *DIAG or *INFO?
If that is the case, you'll need to set up a RCVMSG loop between CALL
PGM1 and CALL PGM2 to receive these types of messages.
If this reply did not seem helpful, please post the RPG code that is
'throwing the error message', or even better, write an entirely new,
tiny RPG program that simply throws a message of the kind you want to
trap in the CLP and post that. This way the list can run the exact
same code that you are.
--buck
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.