Using the attention identifier

This information is part of the input in many applications, and you may also need it to interpret the input correctly.

For example, in the "quick update" transaction, we need some method for allowing the clerk to exit our transaction, and we have not yet provided for this. Suppose that we establish the convention that pressing PF12 causes you to leave control of the transaction. We would then code the following after our RECEIVE MAP command:

       IF EIBAID = DFHPF12,
           EXEC CICS SEND CONTROL FREEKB ERASE END-EXEC
           EXEC CICS RETURN END-EXEC.

This would end the transaction without specifying which one should be executed next, so that the operator would regain control. The SEND CONTROL command that precedes the RETURN unlocks the keyboard and clears the screen, so that the operator is ready to enter the next request.

The hexadecimal values that correspond to the various attention keys are defined in a copy book called DFHAID. To use these definitions, you simply copy DFHAID into your working storage, in the same way that you copy DFHBMSCA to use the predefined attributes byte combinations (see Attribute value definitions: DFHBMSCA). The contents of the DFHAID copy book are listed in the CICS Application Programming Reference manual.

Using the HANDLE AID command

You can also use a HANDLE AID command to identify the attention key used (unless you are writing in C or C++, which does not support HANDLE AID commands). 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.

For example, an alternative to the "escape" code just shown would be:

       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 particular 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 exceptional condition that occurs and whether or not a HANDLE CONDITION is active for that exception. HANDLE AID can thus mask an exceptional condition if you check for it with HANDLE CONDITION. For this reason you may prefer to use an alternative test for the AID or exceptional conditions or both. You can check EIBAID for the AID and use the RESP option or check EIBRESP for exceptions. You need to be especially aware of MAPFAIL in this respect, as noted on page MAPFAIL and other exceptional conditions.

[[ Contents Previous Page | Next Page Index ]]