Error handling and abnormal termination

Methods JCICS class EXEC CICS commands
abend(), forceAbend() Task ABEND
ABEND
To initiate an ABEND from a Java program, invoke one of the the Task.abend() methods. This causes an abend condition to be set in CICS and an AbendException to be thrown. If the AbendException is not caught within a higher level of the application object, or handled by an ABEND-handler registered in the calling program (if any), CICS terminates and rolls back the transaction.
The different abend() methods are:
  • abend(String abcode), which causes an ABEND with the ABEND code abcode.
  • abend(String abcode, boolean dump), which causes an ABEND with the ABEND code abcode. If the dump parameter is false, no dump is taken.
  • abend(), which causes an ABEND with no ABEND code and no dump.
ABEND CANCEL
To initiate an ABEND that cannot be handled, invoke one of the Task.forceAbend() methods. As described above, this causes an AbendCancelException to be thrown which can be caught in Java programs. If you do so, you must re-throw the exception to complete ABEND_CANCEL processing, so that, when control returns to CICS, CICS will terminate and roll back the transaction. You should catch AbendCancelException only for notification purposes and then re-throw it.
The different forceAbend() methods are:
  • forceAbend(String abcode), which causes an ABEND CANCEL with the ABEND code abcode.
  • forceAbend(String abcode, boolean dump), which causes an ABEND CANCEL with the ABEND code abcode. If the dump parameter is false, no dump is taken.
  • forceAbend(), which causes an ABEND CANCEL with no ABEND code and no dump.