Using the HANDLE AID command

You can use a HANDLE AID command to identify the attention key used.

HANDLE AID is used to specify the label to which control is to be passed when an attention identifier (AID) is received from a display device.

Restriction: This command is supported only in COBOL, PL/I, and assembler language applications (but not AMODE(64) assembler language applications). It is not supported in all other supported high level languages.

HANDLE AID works like other HANDLE commands. You issue it before the first RECEIVE command to which it applies, and it causes a program branch on completion of subsequent RECEIVEs if a key named in the HANDLE AID is used.

The following example shows an alternative to the escape code:
       EXEC CICS HANDLE AID PF12(ESCAPE) END-EXEC.
       ...
       EXEC CICS RECEIVE MAP('QUPMAP') MAPSET('QUPSET') ...
       ...
   ESCAPE.
       EXEC CICS SEND CONTROL FREEKB ERASE END-EXEC
       EXEC CICS RETURN END-EXEC.

HANDLE AID applies only to RECEIVE commands in the same program. The specification for a key remains in effect until another HANDLE AID in the same program supersedes it by naming a new label for the key, or terminates it by naming the key with no label. A RESP, RESP2, or NOHANDLE option on a RECEIVE command exempts that command from the effects of HANDLE AID specifications, but they remain in effect otherwise.

If you have a HANDLE active for an AID received during an input operation, control goes to the label specified in the HANDLE AID, regardless of any exception condition that occurs and whether a HANDLE CONDITION is active for that exception. Therefore, HANDLE AID can mask an exception condition if you check for it with HANDLE CONDITION. It can be preferable to use an alternative test for the AID, the exceptional conditions, or both. You can check EIBAID for the AID, and use the RESP option or check EIBRESP for exceptions. This situation is especially significant for the MAPFAIL condition; see MAPFAIL and other exception conditions.