Exception actions
Exception actions define the type of action to be taken when an exception occurs.
There are five exception actions that can be executed if an exception is raised:
STOP- The program is immediately terminated. A message is displayed to the standard error with the location of the related statement, the error number, and the details of the exception.
CONTINUE- The program continues normally. The exception is ignored, but can be checked by testing the
STATUSregister, or the SQLCA.SQLCODE register for SQL errors. CALLexception-function- The function exception-function is called by the runtime system. The function can be defined in any module, and must have zero
parameters and zero return values. The
STATUSvariable will be set to the corresponding error number. GOTOexception-label- The program execution continues at the label identified by exception-label,
as if a
GOTOinstruction was issued after trapping the exception. RAISE- This statement instructs the runtime system that the exception must propagated to the calling
function.Important: The
WHENEVER [ANY] ERROR RAISEis not supported in aREPORTroutine.