z/OS Language Environment Writing Interlanguage Communication Applications
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


COBOL to PL/I condition handling

z/OS Language Environment Writing Interlanguage Communication Applications
SA38-0684-00

This section offers two scenarios of condition handling behavior in a COBOL to PL/I ILC application. If an exception occurs in a COBOL program, the set of possible actions is as described in Exception occurs in COBOL. If an exception occurs in a PL/I routine, the set of possible actions is as described in Exception occurs in PL/I.

If a PL/I routine is currently active on the stack, PL/I language semantics can be applied to handle conditions that occur in non-PL/I routines within an ILC application. For example, PL/I semantics apply to Language Environment hardware conditions that map directly to PL/I conditions such as ZERODIVIDE, even if they occur in a non-PL/I routine. Also, PL/I treats any unknown condition of severity 2 or greater as the ERROR condition. In a case in which a COBOL-specific condition of severity 2 or greater is passed to a PL/I stack frame, an ERROR ON-unit can handle it on the first pass of the stack.

However, some conditions can be handled only by the HLL of the routine in which the exception occurred. Two examples are:
  • Conditions raised using the PL/I statement SIGNAL are PL/I-specific conditions and can be handled only by PL/I.
  • In a COBOL program, if a statement has a condition handling clause added to a verb (such as ON EXCEPTION), the condition is handled within COBOL. For example, the ON SIZE clause of a COBOL DIVIDE verb (which includes the logical equivalent of zero divide condition) is handled completely within COBOL.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014