HANDLE CONDITION

Handles conditions.

Syntax

HANDLE CONDITION

Read syntax diagramSkip visual syntax diagramHANDLE CONDITIONcondition( label)
Note:
  1. HANDLE CONDITION is not supported for C or C++ programs.
  2. In a PL/I application program, a branch to a label in an inactive procedure or in an inactive begin block, caused by a condition, produces unpredictable results.

Description

HANDLE CONDITION specifies the processing that is to be performed when a named condition occurs.

For a list of all the conditions that can occur during the execution of CICS® commands, see CICS conditions.

If you omit label, any HANDLE CONDITION that is in effect for that condition is deactivated, and the default action for the condition is taken if the condition occurs.

No more than 16 conditions are allowed in the same HANDLE CONDITION command; you must specify additional conditions in further commands.

You must ensure that the HANDLE CONDITION command is executed before the command that might cause the associated condition. Note that the HANDLE CONDITION command for a given condition applies only to the program in which it is specified.

The HANDLE CONDITION command:
  • Remains active while the program is running, or until:
    • An IGNORE CONDITION command for the same condition is encountered, in which case the HANDLE CONDITION command is overridden.
    • Another HANDLE CONDITION command for the same condition is encountered, in which case the new command overrides the previous one.
  • Is temporarily deactivated by the NOHANDLE or RESP option on a command.
  • Is suspended by a PUSH HANDLE command until a corresponding POP HANDLE is encountered at the same link level.

If a condition occurs that was not specified in a HANDLE CONDITION or IGNORE CONDITION command, the default action for the condition is taken, unless that action is to terminate the task abnormally, in which case the ERROR condition occurs. If the ERROR condition was specified in a HANDLE CONDITION or IGNORE CONDITION command, the action (possibly none) for ERROR is taken.

You can use the ERROR condition in a HANDLE CONDITION list to specify that all other conditions pass control to the same label.

Options

condition(label)
Specifies the name of the condition; label specifies the program label to which control is to be passed if the condition occurs.
The following conditions are supported for compatibility with other CICS products. They are non-operational in TXSeries for Multiplatforms.
  • ALLOCERR
  • CBIDERR
  • CCERROR
  • DSIDERR
  • DSSTAT
  • ENDINPT
  • EOC
  • EODS
  • EOF
  • FUNCERR
  • IGREQCD
  • IGREQID
  • INBFMH
  • INVERRTERM
  • INVEXITREQ
  • INVLDC
  • INVPARTN
  • INVPARTNSET
  • INVTSREQ
  • MAPERROR
  • NAMEERROR
  • NODEIDERR
  • NONVAL
  • NOPASSBKRD
  • NOPASSBKWR
  • NOSPOOL
  • NOSTART
  • OPENERR
  • OVERFLOW
  • PARTNFAIL
  • RDATT
  • RETPAGE
  • RTEFAIL
  • RTESOME
  • SELNERR
  • SESSBUSY
  • SESSIONERR
  • SPOLBUSY
  • SPOLERR
  • STRELERR
  • TCIDERR
  • TSIOERR
  • UNEXPIN
  • WRBRK
  • WRONGSTAT

Examples

The following example shows how to handle the conditions, including DUPREC and LENGERR, that can occur when you use a WRITE command to add a record to a file. Suppose that you want DUPREC to be handled as a special case; that you want standard system action (that is, to terminate the task abnormally) to be taken for LENGERR; and that you want all other conditions to be handled by the error routine ERRHANDL. You would code:
EXEC CICS HANDLE CONDITION
          ERROR(ERRHANDL)
          DUPREC(DUPRTN)
          LENGERR