Error handling and abnormal termination
To initiate an ABEND from a Java program, you must invoke one of the Task.abend() or Task.forceAbend() methods.
| Methods | JCICS class | EXEC CICS commands |
|---|---|---|
| abend() , forceAbend() | Task | ABEND |
- ABEND
- To initiate an ABEND from a Java program, invoke
one of 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. Only catch the
AbendCancelException
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.