Attention - Interrupt signal
An Attention interrupt, often triggered by the `PA1` (Program Attention 1) key on a 3270 terminal, is a hardware-generated signal sent to the z/OS operating system. Its primary purpose is to allow a user to regain control of their terminal session, typically to interrupt a running program or command that is unresponsive or taking too long.
Key Characteristics
-
- User-Initiated: Primarily generated by a user pressing a specific Program Attention key (commonly
PA1) on a 3270-type terminal connected to the mainframe. - Asynchronous Event: It's an external asynchronous interrupt, meaning it can occur at any point during program execution, independent of the program's current instruction flow.
- OS Interception: When an Attention interrupt occurs, the hardware passes control to the z/OS supervisor, which then determines the appropriate action based on the current context (e.g., TSO/E session, batch job).
- Regain Control: In a TSO/E session, the most common outcome is that the operating system attempts to stop the currently executing program or command and return control to the TSO READY prompt or a command processor.
- Program Handling: Application programs (especially those running under TSO/E) can establish routines to intercept and process Attention interrupts, allowing for graceful termination, status display, or other custom actions instead of immediate termination.
- Not an Error: Unlike program checks or abends, an Attention interrupt is not an indication of a program error but rather a user's request for intervention.
- User-Initiated: Primarily generated by a user pressing a specific Program Attention key (commonly
Use Cases
-
- Interrupting a Hung TSO Session: If a TSO/E command or an interactive program becomes unresponsive or enters an infinite loop, pressing
PA1can often break the loop and return control to the user. - Stopping Long-Running Commands: For commands or utilities that are taking an unexpectedly long time to complete, an Attention interrupt can be used to stop their execution and prevent excessive resource consumption.
- Debugging Interactive Programs: During interactive debugging sessions, an Attention interrupt can be used to pause program execution and return control to the debugger, allowing the user to inspect variables or change execution flow.
- Graceful Program Exit: Well-designed interactive programs can use Attention interrupt handling to prompt the user for confirmation before exiting, save work, or perform cleanup operations.
- Interrupting a Hung TSO Session: If a TSO/E command or an interactive program becomes unresponsive or enters an infinite loop, pressing
Related Concepts
The Attention interrupt is closely tied to 3270 terminals and their Program Attention (PA) keys, particularly PA1. It is a fundamental mechanism for user interaction and control within TSO/E (Time Sharing Option/Extensions) and ISPF (Interactive System Productivity Facility) environments. While it's a user-initiated interrupt, the z/OS supervisor is responsible for its initial handling. Programs can implement condition handling (e.g., using ESTAE macros in Assembler or ON ATTENTION in PL/I) to define specific actions upon receiving an Attention interrupt, preventing an immediate abend or session termination.
- Implement Program Handling: For interactive applications, especially those performing critical updates or long computations, implement robust Attention interrupt handling to ensure data integrity and allow for graceful recovery or exit.
- Educate Users: Inform users about the appropriate use of the
PA1key, emphasizing that it's for regaining control, not a substitute for proper program termination or error handling. - Distinguish from Program Errors: Understand that an Attention interrupt is a user request, not an error condition. Avoid confusing it with program checks or abends, which indicate underlying software issues.
- Test Handling Routines: Thoroughly