The following then occurs:
1. Since there are no error indicators coded in PRC2, PRC2 cannot handle the
function check, and so it is unhandled.
2. Since it is a function check, an inquiry message is issued describing the origi-
nating condition.
3. Depending on the response to the inquiry message, PRC2 may be terminated
and the exception percolated to PRC1 (response is 'C') or processing may con-
tinue in PRC2 (response is 'G').
Optimization Considerations
While running a *FULL optimized program, the optimizer may keep frequently used
values in machine registers and restore them to storage only at predefined points
during normal program processing. Exception handling may break this normal proc-
essing and consequently program variables contained in registers may not be
returned to their assigned storage locations.
Specifically, variables may not contain their current values if an exception occurs
and you recover from it using one of:
*PSSR error subroutine
INFSR error subroutine
User-defined exception handler
The Go ('G') option from an inquiry message.
The Retry ('R') option from an inquiry message.
ILE RPG automatically defines indicators such that they contain their current values
even with full optimization. To ensure that the content of fields or data structures
contain their correct (current) values, specify the NOOPT keyword on the appro-
priate Definition specification.
For more information on the NOOPT keyword, see
ILE RPG for AS/400 Reference
.
For more information on optimization, see “Changing the Optimization Level” on
page 87.
Using RPG-Specific Handlers
ILE RPG provides three ways for you to enable HLL-specific handlers and to
recover from the exception:
1. error indicators or 'E' operation code extender
2. INFSR error subroutine
3. *PSSR error subroutine.
You can obtain more information about the error which occurred by coding the
appropriate data structures and querying the relevant data structure fields.
If you are using the 'E' extender instead of error indicators, the relevant program
and file error information can be obtained by using the %STATUS and %ERROR
built-in-functions.
226 ILE RPG for AS/400 Programmer's Guide