HANDLE CONDITION

Top  Previous  Next

You use HANDLE CONDITION to specify the label to which control is to be passed if a condition occurs. You must include the name of the condition and, optionally, a label to which control is to be passed if the condition occurs.

If you omit "label", any HANDLE CONDITION command for the condition is deactivated, and the default action is taken if the condition occurs. This is independent of the setting of the generalized ERROR condition.

You must ensure that the HANDLE CONDITION command is executed before the command that may give rise to the associated condition.

If a condition occurs that is not specified in a HANDLE CONDITION or IGNORE CONDITION command, the default action is taken. If, however, the default action for a condition not specified in a HANDLE CONDITION or IGNORE CONDITION command terminates the task abnormally, and the condition ERROR has been specified, the action for ERROR is taken.

The execution key that the label receives control in, is the execution key that the program was running in when the HANDLE CONDITION command was issued.

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.

The C language does not support HANDLE CONDITION.

For information about supported conditions, see "Supported Conditions".

HANDLE  CONDITION
<condition> (<label>)