PL/I condition handling actions

Refer to Figure 1 throughout the following summary of the steps taken to process a condition when there are only PL/I routines on the stack.

Figure 1. PL/I condition processing
Summary of the steps taken to process a condition when there are only PL/I conditions on the stack.
  1. Assume a condition such as CONVERSION, which is severity 3, occurs in routine 4.
  2. Language Environment moves down the stack towards the earliest stack frame. If a PL/I ON-unit is established for the CONVERSION condition, it is given control.
  3. If all stack frames have been visited and no ON CONVERSION unit was found, a message is issued. The condition is promoted to the ERROR condition if it meets any of the qualifications listed in Promoting conditions to the PL/I ERROR condition. Otherwise, the PL/I implicit action occurs. A CONVERSION condition would be promoted to ERROR.
  4. The Language Environment condition manager makes another pass of the stack, beginning in Routine 4 where the original condition occurred. If a PL/I ERROR ON-unit is established, it is invoked.
  5. If either of the following occurs:
    • An ERROR ON-unit is found, but it does not issue a GOTO out of block
    • No ERROR ON-unit is found
    then the ERROR condition is promoted to T_I_U (Termination Imminent due to an Unhandled Condition). T_I_U maps to the PL/I FINISH condition. (See Termination imminent step for a discussion of T_I_U.)
  6. Language Environment makes yet another pass of the stack, beginning in Routine 4 where the original condition occurred. If a PL/I FINISH ON-unit is established, it is invoked.
  7. If all stack frames have been visited, and no FINISH ON-unit issued a GOTO out of block, then Language Environment begins thread termination activities in response to the unhandled condition. Since a message was issued for the CONVERSION condition before it was promoted to the ERROR condition, no message is issued at this time.