Processing program interruptions (SPIE, ESPIE)

The SPIE1 macro enables a problem program executing in 24-bit addressing mode to specify an error exit routine to get control in response to one or more program error interruptions. The ESPIE macro extends the function of SPIE to callers in 31-bit addressing mode. Callers in both 24-bit and 31-bit addressing mode can use the ESPIE macro.

If a program interruption occurs, the SPIE/ESPIE exit receives control only when all of the following conditions exist:
  • The interrupted program is a problem state program.
  • The program interrupt code is in the range 1–15 and 17.
  • For the SPIE macro, the interrupted program is in primary address space control (ASC) mode. For the ESPIE macro, the interrupted program is in primary or access register (AR) ASC mode. For both the SPIE and ESPIE macros, the interrupt occurred when the primary, home, and secondary address space were the same.
Note: SPIE/ESPIE exits cannot percolate to FRR or ESTAE-type recovery routines.

SPIE/ESPIE exits that were established for the specific program interruption that occurred get control before any RTM (FRR or ESTAE-type) routines, so RTM is disabled for this unit of work. However, if the SPIE/ESPIE exit encounters an error, RTM will process this secondary error.

A SPIE exit routine established while executing in 24-bit addressing mode does not receive control if the program executing is in 31-bit addressing mode at the time of the interruption.

Each succeeding SPIE/ESPIE macro completely overrides any previous SPIE/ESPIE macro specifications for the task. The specified exit routine gets control in the key of the TCB when one of the specified program interruptions occurs in any problem program of the task. When a SPIE macro is issued from a SPIE exit routine, the program interruption element (PIE) is reset (zeroed). Thus, a SPIE exit routine should save any required PIE data before issuing a SPIE.

If a caller issues an ESPIE macro from within a SPIE exit routine, it has no effect on the contents of the PIE. However, if an ESPIE macro deletes the last SPIE/ESPIE environment, the PIE is freed, and the SPIE exit cannot retry.

If the current SPIE environment is cancelled during SPIE exit routine processing, the system will not return to the interrupted program when the SPIE program terminates. Therefore, if the SPIE exit routine wishes to retry within the interrupted program, a SPIE cancel should not be issued within the SPIE exit routine.

The SPIE macro can be issued by any problem program being executed in the performance of the task. The system automatically deletes the SPIE exit routine when the request block (RB) that created the SPIE macro terminates.

When using Floating Point Registers (FPRs) an ESPIE routine will receive the DXC value in its parameter area, and should use this value rather than the value in the Floating Point Control (FPC) register.

If a retry is to be done, an ESPIE routine can manually change the values of the FPRs and FPC register. Changes to the nonvolatile fields (that is, the IEEE settings) in the FPC register must be made carefully as this could affect the processing of the rest of the current program, and possibly subsequent programs.

The SPIE and ESPIE macros and their related services are discussed in detail in z/OS MVS Programming: Assembler Services Guide, z/OS MVS Programming: Assembler Services Reference ABE-HSP, and z/OS MVS Programming: Assembler Services Reference IAR-XCT. The syntax of both the SPIE and the ESPIE macros appears in z/OS MVS Programming: Authorized Assembler Services Reference SET-WTO.

1 IBM® recommends that you use the ESPIE macro rather than SPIE.