AT OCCURRENCE command

Gives z/OS® Debugger control on a language or Language Environment® condition or exception or an MVS or CICS® ABEND.

Read syntax diagramSkip visual syntax diagram
>>-AT--+--------------+--OCCURRENCE--+-condition-----------+---->
       '-every_clause-'              |    .-,---------.    |   
                                     |    V           |    |   
                                     '-(----condition-+--)-'   

>--command--;--------------------------------------------------><

condition
A valid condition or exception. This can be one of the following codes or conditions:
  • A Language Environment symbolic feedback code.
  • A language-oriented keyword or code, depending on the current programming language setting.
  • An MVS System or User ABEND code Sxxx or Uxxx, where xxx is three hexadecimal digits corresponding to the desired ABEND code. These codes are valid only when you are running without the Language Environment run time.
  • Any four-character string representing a CICS ABEND code. This code is valid only when you are running without the Language Environment run time.

Following are the C and C++ condition constants; they must be uppercase and not abbreviated:

SIGABND
SIGABRT
SIGFPE

SIGILL
SIGINT
SIGIOERR
SIGSEGV

SIGTERM
SIGUSR1
SIGUSR2
THROWOBJ

When a C++ user specifies AT CONDITION THROWOBJ, z/OS Debugger transfers control to the user at the point of the throw in C++ code.

PL/I condition constants can be used. For conditions associated with file handling, the file reference can be a wildcard.

There are no COBOL condition constants. Instead, an Language Environment symbolic feedback code must be used, for example, CEE347.

The TRAP(ON) run-time option must be used to stop on Language Environment conditions or MVS or CICS Abends.

command
A valid z/OS Debugger command.

Program conditions and condition handling vary from language to language. The methods the OCCURRENCE breakpoint uses to adapt to each language are described below.

For C and C++:

When a C and C++ or an Language Environment condition occurs during your session, the following series of events takes place:
  1. z/OS Debugger is started before any C or C++ signal handler.
  2. If you set an OCCURRENCE breakpoint for that condition, z/OS Debugger processes that breakpoint and executes any commands you have specified. If you did not set an OCCURRENCE breakpoint for that condition, and:
    • If the current test-level setting is ALL, z/OS Debugger prompts you for commands or reads them from a commands file.
    • If the current test-level setting is ERROR, and the condition has an error severity level (that is, anything but SIGUSR1, SIGUSR2, SIGINT, or SIGTERM), z/OS Debugger gets commands by prompting you or by reading from a commands file.
    • If the current test-level setting is NONE, z/OS Debugger ignores the condition and returns control to the program.

You can set OCCURRENCE breakpoints for equivalent C and C++ signals and Language Environment conditions. For example, you can set AT OCCURRENCE CEE345 and AT OCCURRENCE SIGSEGV during the same debug session. Both indicate an addressing exception and, if you set both breakpoints, no error occurs. However, if you set OCCURRENCE breakpoints for a condition using both its C, C++, and Language Environment designations, the Language Environment breakpoint is the only breakpoint triggered. Any command list associated with the C condition is not executed.

You can use OCCURRENCE breakpoints to control your program's response to errors.

Usage notes
Examples

Refer to the following topics for more information related to the material discussed in this topic.