× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

How a CL program can handle error message which are coming from called
RPGLE programs
from inside this CL program.

For example CL1 called P1 & P2 two RPGLE programs which have custtomized
errors meesaged defined in them which throw error messages in case certain
conditions are
met. so objective is to track such error messages inside this CL program so
that for example if P1 threw any such customized or may be any
unforeseen error then it should not try to execute P2.
For this I tried below code :-
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 I want to end this CL program the moment it tracks any customized
or any unforeseen error in PGM1.
If there is not any error in PGM1 then only it should call PGM2 and same if
PGM2 too have any such customized error message or any unforeseen error
message that could populate upon calling this PGM2 from this CL program
then also this entire CL program should be ended. But not sure how to
achieve this.


Thanks much....

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.