Command reference / job
SETATNPGM
Set Attention Program
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 handling of the attention key does not change the auxiliary storage pool (ASP) group that is in effect. The ASP group determines the library name space of the thread. If the attention handling program resides in an independent ASP and if that ASP is not part of the library name space for the thread at the time the attention key is handled, the intended program will not be found. To avoid potential problems when applications change the library name space, the program should reside in the system ASP or a basic user ASP.
Allowed environments: *INTERACT, *IPGM, *IREXX, *EXEC.
Positional parameters: 2.
Parameters
PGM
Program
Specifies the qualified name of the program to be the Attention key handler at this recursion level. This is a required parameter.
Suggested / special values:
*CURRENT, *PRVINVLVL
*CURRENT- The program name of the Attention key handler currently in effect is used as the value of this parameter.
*PRVINVLVL- The Attention key handler in effect at the previous recursion level is reinstated as the Attention key handler at this recursion level. The Set attention key (SET) parameter is not allowed if this special value is specified, because the SET status of the previous recursion level is also reinstated. This option is used when a program has specified an Attention program and wants to revert back to a previous level.
Qualifier 1: Program: name- Specify the name of the Attention key handler program.
Qualifier 2: Library: name- Specify the library where the attention program is located.
*LIBL- All libraries in the thread's library list are searched until a match is found.
*CURLIB- The current library for the thread is used to locate the object. If no library is specified as the current library for the thread, the QGPL library is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Program
Program
Library
Library
Suggested / special values:
*LIBL, *CURLIB
SET
Set attention key
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.
Allowed values:
*ON, *OFF
*ON- The Attention key handler specified in the Program (PGM) parameter is called when the Attention key is pressed.
*OFF- The Attention key handler specified in the Program (PGM) parameter is not called when the Attention key is pressed.
Examples
SETATNPGM PGM(QGPL/ATTN) SET(*ON)
Setting the ATTN Key Handler. 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.
SETATNPGM PGM(*CURRENT) SET(*OFF)
Setting the Attention Key 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.
SETATNPGM PGM(*PRVINVLVL)
Previous Recursion-Level Support. 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.
SETATNPGM PGM(QWSSYSRQ)
Emulating the System Request Key. 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.
Generated from os/cl/catalog/SETATNPGM.json and os/cl/help/SETATNPGM.json.