CICS exception tracing is always done by CICS when it detects an exception condition. The sorts of exception that might be detected include bad parameters on a domain call, and any abnormal response from a called routine. The aim is "first failure data capture", to record data that might be relevant to the exception as soon as possible after it has been detected.
CICS uses a similar mechanism for both exception tracing and "normal" tracing. Exception trace entries are made from specific points in CICS code, and data is taken from areas that might provide information about the cause of the exception. The first data field in the trace entry is usually the parameter list from the last domain call, because this can indicate the reason for the exception.
The exception trace points do not have an associated "level" attribute, and trace calls are only ever made from them when exception conditions occur.
Exception trace entries are always written to the internal trace table, even if no trace destinations at all are currently STARTED. That is why there is always an internal trace table in every CICS region, to make sure there is always somewhere to write exception trace entries. If the other trace destinations are STARTED, the exception trace entries are written there, as well.
You can select tracing options so that exception traces only are made to an auxiliary trace data set. This is likely to be useful for production regions, because it enables you to preserve exception traces in auxiliary storage without incurring any general tracing overhead. You need to disable all standard and special task tracing, and enable auxiliary trace:
Exception traces are now made to an auxiliary trace data set, but there is no other tracing overhead.
The format of an exception trace entry is almost identical to that of a normal trace entry. However, you can identify it by the eye-catcher *EXC* in the header.
The EXCEPTION option on the EXEC CICS ENTER TRACENUM command enables user programs to write a trace entry to the trace destinations, even when the master user trace flag is off. User exception trace entries are always written to the internal trace table (even if internal tracing is set off), but are written to other destinations only if they are active.
The user exception trace entries CICS writes are identified by the character string *EXCU in any formatted trace output produced by CICS utility programs. For example, an application program exception trace entry generated by an EXEC CICS ENTER TRACENUM() EXCEPTION command appears in formatted trace output as:
USER *EXCU - APPLICATION-PROGRAM-EXCEPTION
If you use the exit programming interface (XPI) trace control function to write user trace entries, you can use the DATA1 block descriptor to indicate whether the entry is an exception trace entry. Enter the literal ‘USEREXC’ in the DATA1 field on the DFHTRPTX TRACE_PUT call to identify an exception trace entry. This is interpreted by the trace formatting utility program as follows:
USER *EXCU - USER-EXIT-PROGRAM-EXCEPTION
See the CICS® Customization Guide for programming information about XPI trace control function.