TRY Statements and Library Delinkage

A TRY statement can be skipped if a process is executing a procedure imported from a library, and one of the following conditions occurs:

  • The library process is discontinued.

  • The library is a connection library and is delinked by a DELINKLIBRARY statement with the ABORT option.

The behavior that results depends on whether the library is a server library or a connection library, and whether the TRY statement is safe or unsafe. For example, in TRY Statements and Library Delinkages, a process has invoked procedure PROCB in connection library CL.

Figure 2. TRY Statements and Library Delinkages

TRY Statements and Library Delinkages


The following table explains which TRY error-handling code is executed for the preceding example:

WHEN the TRY statement in PROCC is . . .

AND the library is a . . .

THEN . . .

Safe

Server library

No TRY statements are executed; the process is discontinued.

Safe

Connection library

The system deletes PROCD, PROCC, and CL.PROCB from the stack, and then executes the TRY code in PROCA.

Unsafe

Server library or connection library

The system executes the TRY error-handling code in PROCC before deleting PROCC from the stack. The TRY code is responsible for cutting back PROCB (for example, by means of a bad GO TO statement).