Where allowed to run: Interactive environments (*INTERACT *IPGM *IREXX *EXEC) Threadsafe: No |
Parameters Examples Error messages |
The Set Attention Program (SETATNPGM) command sets up a program that is called when the Attention key is pressed. The setting is in effect for this recursion level and lower levels if more programs are called, but it is no longer in effect if the job returns from this recursion level to the previous one. If the Attention key handler's status is on, the specified program is called when the key is pressed. No parameters are passed to the Attention key handler when it is called. The Attention handling program runs in the same process with the same job attributes, overrides, and group authorities as the program that issued the SETATNPGM command. However, program adopted authority is not carried over. The Attention handling program must not reside in an independent auxiliary storage pool (ASP). It must reside in the system ASP or a basic user ASP.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
PGM | Program | Single values: *CURRENT, *PRVINVLVL Other values: Qualified object name |
Required, Positional 1 |
Qualifier 1: Program | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
SET | Set attention key | *ON, *OFF | Optional, Positional 2 |
Top |
Specifies the qualified name of the program to be the Attention key handler at this recursion level.
This is a required parameter.
Single values
Qualifier 1: Program
Qualifier 2: Library
Top |
Specifies whether the Attention key handler indicated in the Program (PGM) parameter is called when the Attention key is pressed. This parameter is not allowed if *PRVINVLVL is specified for the PGM parameter.
Top |
Example 1: Setting the ATTN Key Handler
SETATNPGM PGM(QGPL/ATTN) SET(*ON)
This command causes the program QGPL/ATTN to become the ATTN key handler. Because SET(*ON) is specified, the program is called when the ATTN key is pressed.
Example 2: Setting the Attention Key Off
SETATNPGM PGM(*CURRENT) SET(*OFF)
The current attention handling program has its status changed to SET(*OFF). Because the status is SET(*OFF) when the ATTN key is pressed, the attention handling program is not called.
Example 3: Previous Recursion-Level Support
SETATNPGM PGM(*PRVINVLVL)
The attention handling program and status that was in effect at the previous recursion level is reinstated at this recursion level. If no attention handler is in effect, after this command is run nothing happens when the ATTN key is pressed.
Example 4: Emulating the System Request Key
SETATNPGM PGM(QWSSYSRQ)
The system-supplied program QWSSYSRQ will be called when the ATTN key is pressed. This system program allows the ATTN key to act as a system request key by showing the system request menu on the display when the ATTN key is pressed.
Top |
Top |