Handling Exceptions on the CALL Statement
CALL "REPORTA"
IN LIBRARY "MYLIB"
ON EXCEPTION
DISPLAY "Program REPORTA not available."
END-CALL
If program REPORTA is unavailable or cannot be found in library MYLIB, control will continue with the ON EXCEPTION clause.
The ON EXCEPTION and ON OVERFLOW phrases handle only the exceptions that result from the failure of the CALL operation itself.
The ON EXCEPTION conditions that are signalled by the CALL operation are handled by a condition handler registered at priority 130. At this priority level, only conditions signalled to the specific call stack entry where the CALL statement exists will be handled. At this priority level, user written condition handlers may not get a chance to see signalled conditions.
If you do not have ON EXCEPTION and ON OVERFLOW phrases on the CALL statements in your application and the CALL statement fails, then the exception is handled by ILE condition handling. See ILE Condition Handling for an overview of ILE condition handling.