CICS exception handling in Java programs

CICS® ABENDs and exceptions are integrated into the Java™ exception-handling architecture to handle problems that occur in CICS.

All regular CICS ABENDs are mapped to a single Java exception, AbendException, whereas each CICS condition is mapped to a separate Java exception. This leads to an ABEND-handling model in Java that is similar to the other programming languages; a single handler is given control for every ABEND, and the handler must query the particular ABEND and then decide what to do.

If the exception representing a condition is caught by CICS itself, it is turned into an ABEND.

Java exception-handling is fully integrated with the ABEND and condition-handling in other languages, so that ABENDs can propagate between Java and non-Java programs, in the standard language-independent way. A condition is mapped to an ABEND before it leaves the program that caused or detected the condition.

However, there are several differences to the abend-handling model for other programming languages, resulting from the nature of the Java exception-handling architecture and the implementation of some of the technology underlying the Java API:
  • ABENDs that cannot be handled in other programming languages can be caught in Java programs. These ABENDs typically occur during sync point processing. To avoid these ABENDs interrupting Java applications, they are mapped to an extension of an unchecked exception; therefore they do not have to be declared or caught.
  • Several internal CICS events, such as program termination, are also mapped to Java exceptions and can therefore be caught by a Java application. Again, to avoid interrupting the normal case, these events are mapped to extensions of an unchecked exception and do not have to be caught or declared.
Three class hierarchies of exceptions relate to CICS :
  1. CicsError extends java.lang.Error and is the base for AbendError and UnknownCicsError.
  2. CicsRuntimeException extends java.lang.RuntimeException and is in turn extended by:
    AbendCancelException
    Represents a CICS ABEND CANCEL.
    AbendException
    Represents a normal CICS ABEND.
    EndOfProgramException
    Indicates that a linked-to program has terminated normally.
  3. CicsException extends java.lang.Exception and has the subclass:
    CicsConditionException
    The base class for all CICS conditions.