× 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.



On 2020-03-06 4:01 a.m., Bruno VARON wrote:
Hello Peter,

I send CPF9897 message of QCPFMSG, MONMSG keep the message.
but the caller RPG program receive the message too.


I think it is due to the "Program Return Code" of the job. You can see this value in DSPJOB OPTION(*STSA).

When the main procedure of the ILE RPG module ROXBMXR ends abnormally after sending the escape message, ILE RPG sets the return code to '2'. This is done as part of the RPG cycle, so I guess that your ILE RPG module is not a NOMAIN module.

OPM RPG checks this return code after a call, and if the return code is still '2', OPM RPG thinks that the call failed.

ILE RPG does not check the return code after a call unless the call failed some other way.

This is actually mentioned in the ILE RPG Programmer's Guide in the section about difference between ILE RPG and OPM RPG:
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzasc/diffrun.htm

"5. ILE RPG does not interpret return codes that are not 0 or 1 for calls to programs or procedures that end without an exception."

To stop the OPM RPG program from ending in error, you could add an error indicator to the CALL.

Or, you could change the ILE RPG module ROXMBXR so that it is a NOMAIN module, where the code is in a subprocedure called ROXMBXR. When a subprocedure ends abnormally, ILE RPG does not set the 'Program Return Code' to '2'.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.