Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

ANYCONDITION condition

Status
ANYCONDITION is always enabled.
Result
The result is the same as for the underlying condition.
Cause and syntax
SIGNAL ANYCONDITION is not allowed. ANYCONDITION can be used only in ON (and REVERT) statements to establish (and cancel) an ON-unit which will trap any condition, including the CONDITION condition, that occurs in a block and which is not trapped by some other eligible ON-unit in that block.

In the following example, all ERROR conditions would be handled in the begin-block, the FINISH condition would be handled by the system, and all other conditions would be handled by the call to the routine named handle_All_Others.

 
on error
begin;

·
·
·
end;   on finish system; on anycondition call Handle_all_others;
Note:
To avoid infinite loops, the use of ON FINISH (as in the previous example) may be necessary when ON ANYCONDITION is used.

Note that when a condition is raised, the call stack will be walked (backwards) to search for a block that has an ON-unit for that condition. The search will stop when the first block with such an ON-unit or with an ON ANYCONDITION ON-unit is found. If no such ON-units are found and the implicit action for the condition is to promote it to ERROR, the stack will then (and only then) be walked again to search for an ON ERROR ON-unit.

You can use the ONCONDID built-in function in an ANYCONDITION ON-unit to determine what condition is being handled, and the ONCONDCOND built-in function to determine the name of the CONDITION condition. Other ON built-in functions, such as ONFILE, can be used to determine the exact cause and other related information. These built-in functions are listed in Built-in functions, pseudovariables, and subroutines..

Read syntax diagramSkip visual syntax diagram>>-ANYCONDITION------------------------------------------------><
 
Abbreviation
ANYCOND
Implicit action
The implicit action is that of the underlying condition.
Normal return
Normal return is the same as for the underlying condition.
Condition codes
There are no condition codes unique to the ANYCONDITION.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)