Example of Unhandled Escape Message
The following scenario describes the events which occur when an escape
message is issued and cannot be handled by the procedure in which it occurred.
This scenario has the following assumptions:
- There are two programs, PGM1 and PGM2 which run in the same activation group. Each contains a procedure, PRC1 and PRC2 respectively.
- PRC1 calls PGM2 dynamically and PRC2 receives control.
- The CALL operation code in PRC1 has an error indicator for the call.
- No RPG exception handlers have been coded in PRC2. That is, there is no error indicator coded for the SUBST operation and there is no *PSSR error subroutine.
- PRC2 has a SUBST operation where the Factor 1 entry is a negative number.
When PGM1 calls PGM2, and the SUBST operation is attempted, an exception message, RNX0100, is generated. Figure 1 depicts this scenario and the events which occur.
Figure 1. Scenario for Unhandled Escape
Message

The following then occurs:
- Since there is no error indicator, active MONITOR group, or *PSSR error subroutine coded on the SUBST operation in PRC2, PRC2 cannot handle the program error, and so it is unhandled.
- Since it is not a function check, it is percolated (passed up the call stack) to PRC1.
- PRC1 receives (handles) the same exception message, and sets on the error indicator on the CALL operation with the side effect that PRC2 is terminated.
- Processing then continues in PRC1 with the statement following the CALL operation.
Note: The same exception handling events described would apply
to a procedure call (CALLB operation) as well.