CPF4906 When CLLE Calls RPGLE Same Program Works Correctly If Calling Program Is CLP
This document explains why a CPF4906 is issued when a CLLE calls RPGLE; however, the same program works correctly if calling program is CLP.
Resolving the problem
If your ILE RPG procedure is called by an ILE CL procedure in the same activation group and the caller is monitoring for status or notify messages, your ILE CL caller may get control prematurely because of a notify or status message that the ILE RPG procedure was trying to ignore. For example, if the ILE RPG procedure writes a record to a printer file and the actual printer file has a shorter record length than was declared in the RPG procedure, notify message CPF4906 is sent to the RPG procedure. The RPG exception handling percolates this message which causes the default reply of ’I’ to ignore the message. This allows the output operation to continue normally, and the RPG procedure proceeds to the next instruction. However, when the ILE CL MONMSG gets control, control passes immediately to the action for the MONMSG or the next statement in the ILE CL procedure.
Note: For this problem to occur, the procedure monitoring for the message is not required to be the immediate caller of the RPG procedure. This problem is most likely to occur with a MONMSG in an ILE CL caller; however, it can also occur with other ILE languages that can monitor for notify and status messages, (including ILE RPG using ILE condition handlers enabled using CEEHDLR).
If this problem is encountered, do one of the following:
|o||Ensure that the caller is in a different activation group from the ILE RPG procedure.|
|o||Enable an ILE condition handler in the RPG procedure. In the handler, if the message is one that you want to ignore, indicate that the message should be handled. Otherwise, indicate that it should be percolated. You can also make this handler more generic and have it ignore all messages with a severity of 0 (information) and 1 (warning).|
|Operating System||IBM i 7.1|
|Operating System||IBM i 6.1|
More support for:
Programming (Languages- compilers- tools)
Software version: 5.4.0, 5.4.5, 6.1.0, 6.1.1, 7.1.0, Version Independent
Operating system(s): IBM i
Reference #: N1015106
Modified date: 29 December 2012