ILE RPG Programmer's Guide
Exception Handling within a Cycle-Main Procedure
When an exception occurs within a cycle-main procedure ILE RPG does
the following:
- If an error indicator is present on the calculation specification
and the exception is one that is expected for that operation:
- The indicator is set on
- The exception is handled
- Control resumes with the next ILE RPG operation.
- If an 'E' operation code extender is present on the calculation
specification and the exception is one that is expected for that operation:
- The return values for the built-in funtions %STATUS and %ERROR
are set.
Note:
%STATUS is set when any exception occurs even
if the 'E' extender is not specified.
- The exception is handled
- Control resumes with the next ILE RPG operation.
- If no error indicator or 'E' extender is persent and
the code that generates the exception is in the MONITOR block of a
MONITOR group, control will pass to the on-error section of the MONITOR
group.
- If no error indicator or 'E' extender is present, no
active MONITOR group could handle the exception, and
- you have coded a *PSSR error subroutine and the exception is a
program exception
or
- you have coded a INFSR error subroutine for the file and the exception
is an I/O exception,
then the exception will be handled and control will resume
at the first statement of the error subroutine.
- If no error indicator, 'E' extender, or error subroutine
is coded and no active MONITOR group could handle the exception, then
the RPG default error handler is invoked.
- If the exception is not a function check,
then the exception will be percolated.
- If the exception is a function check, then an inquiry message
will be displayed. If the 'G' or 'R' option is chosen, the function
check will be handled and control will resume at the appropriate point
(*GETIN for 'G' or the same calculation specification that received
the exception for 'R') in the procedure. Otherwise,the function check
will be percolated and the procedure will be abnormally terminated.
See Unhandled Exceptions for a full description of the RPG default
handler.
[ Top of Page | Previous Page | Next Page | Contents |
Index ]