When an exception occurs within a cycle-main procedure ILE RPG does the following:
then the exception will be handled and control will resume at the first statement of the error subroutine.
See Unhandled Exceptions for a full description of the RPG default handler.