ERROR condition

ERROR is always enabled.
An error message is issued if no ON-unit is active when the ERROR condition arises, or if the ON-unit does not use a GOTO (to exit the block) to recover from the condition.
Cause and syntax
The ERROR condition is the implicit action for many conditions. This provides a common condition that can be used to check for a number of different conditions, rather than checking each condition separately.
The ERROR condition is raised under the following circumstances:
  • As a result of the implicit action for a condition, which is to raise the ERROR condition
  • As a result of the normal return action for some conditions, such as SUBSCRIPTRANGE CONVERSION or when no retry is attempted
  • As a result of an error (for which there is no other PL/I-defined condition) during program execution
  • As a result of a SIGNAL ERROR statement
In order to prevent a loop of ERROR conditions, the first statement in any ON ERROR block should be ON ERROR SYSTEM.

Read syntax diagramSkip visual syntax diagramERROR
Implicit action
The message is printed and the FINISH condition is raised.
Normal return
The implicit action is taken.
Condition codes
All codes 1000 and above are ERROR conditions.