CICS - Aid Keys



As we have discussed in earlier modules, AID keys are known as Attention Identifier Keys. CICS can detect only AID keys. After typing all the input, only when the user presses one of the AID keys, the CICS takes control. AID Keys include ENTER, PF1 to PF24, PA1 to PA3, and CLEAR.

Validating AID keys

The key pressed by the user is checked by using EIBAID.

  • EIBAID is one byte long and holds the actual attention identifier value used in the 3270 input stream.

  • CICS provides us with a pre-coded set of variables which can be used in the application program by writing the following statement −

    COPY DFHAID

DFHAID

DFHAID is a copybook which is used in application programs to include CICS pre-coded set of variables. The following content is present in the DFHAID copybook −

01    DFHAID.                             
   02  DFHNULL   PIC  X  VALUE IS ' '.     
   02  DFHENTER  PIC  X  VALUE IS ''''.    
   02  DFHCLEAR  PIC  X  VALUE IS '_'.     
   02  DFHCLRP   PIC  X  VALUE IS '¦'.     
   02  DFHPEN    PIC  X  VALUE IS '='.     
   02  DFHOPID   PIC  X  VALUE IS 'W'.     
   02  DFHMSRE   PIC  X  VALUE IS 'X'.     
   02  DFHSTRF   PIC  X  VALUE IS 'h'.     
   02  DFHTRIG   PIC  X  VALUE IS '"'.     
   02  DFHPA1    PIC  X  VALUE IS '%'.     
   02  DFHPA2    PIC  X  VALUE IS '>'.     
   02  DFHPA3    PIC  X  VALUE IS ','.     
   02  DFHPF1    PIC  X  VALUE IS '1'.     
   02  DFHPF2    PIC  X  VALUE IS '2'.     
   02  DFHPF3    PIC  X  VALUE IS '3'.     
   02  DFHPF4    PIC  X  VALUE IS '4'.     
   02  DFHPF5    PIC  X  VALUE IS '5'.     
   02  DFHPF6    PIC  X  VALUE IS '6'.     
   02  DFHPF7    PIC  X  VALUE IS '7'.     
   02  DFHPF8    PIC  X  VALUE IS '8'.     
   02  DFHPF9    PIC  X  VALUE IS '9'.     
   02  DFHPF10   PIC  X  VALUE IS ':'.     
   02  DFHPF11   PIC  X  VALUE IS '#'.     
   02  DFHPF12   PIC  X  VALUE IS '@'.     
   02  DFHPF13   PIC  X  VALUE IS 'A'.     
   02  DFHPF14   PIC  X  VALUE IS 'B'.     
   02  DFHPF15   PIC  X  VALUE IS 'C'.   
   02  DFHPF16   PIC  X  VALUE IS 'D'.   
   02  DFHPF17   PIC  X  VALUE IS 'E'.   
   02  DFHPF18   PIC  X  VALUE IS 'F'.   
   02  DFHPF19   PIC  X  VALUE IS 'G'.   
   02  DFHPF20   PIC  X  VALUE IS 'H'.   
   02  DFHPF21   PIC  X  VALUE IS 'I'.   
   02  DFHPF22   PIC  X  VALUE IS '¢'.   
   02  DFHPF23   PIC  X  VALUE IS '.'.   
   02  DFHPF24   PIC  X  VALUE IS '<'.   

Example

The following example shows how to use DFHAID copybook in an application program −

IDENTIFICATION DIVISION.                                         
PROGRAM-ID. HELLO.                                               
DATA DIVISION.   
WORKING-STORAGE SECTION.
COPY DFHAID.
PROCEDURE DIVISION.
A000-AIDKEY-PARA.
   EVALUATE EIBAID
      WHEN DFHAID
         PERFORM A000-PROCES-PARA
      WHEN DFHPF1
         PERFORM A001-HELP-PARA
      WHEN DFHPF3
         PERFORM A001-EXIT-PARA
    END-EVALUATE.

Cursor Positioning

There are two ways to override the position specified in the map definition.

  • One way is to specify the screen position relative to line and column number in the CURSOR option on the send map command.

  • Other way is to move -1 to the symbolic map variable suffixed with L. Then, send the map with a CURSOR option in the SEND MAP.

Example

The following example shows how to override the cursor position for the NAME field −

MOVE -1 TO NAMEL
   EXEC CICS SEND 
      MAP ('map-name')
      MAPSET ('name-field')
      ERASE
      FREEKB
      CURSOR
   END-EXEC.

Dynamically Modifying Attributes

While sending a map, if we want to have different attributes for a field other than that is specified in the map, then we can override that by setting the field in the program. Following is the explanation to override attributes of a field −

  • To override the attributes of a field, we must include DFHATTR in the application program. It is provided by CICS.

  • The attribute required can be chosen from the list and moved to the symbolic field variable suffixed with 'A'.

DFHATTR holds the following content −

01  CICS-ATTRIBUTES.
   05  ATTR-UXN            PIC X(01) VALUE SPACE.
   05  ATTR-UXMN           PIC X(01) VALUE 'A'.
   05  ATTR-UXNL           PIC X(01) VALUE 'D'.
   05  ATTR-UXMNL          PIC X(01) VALUE 'E'.
   05  ATTR-UXBL           PIC X(01) VALUE 'H'.
   05  ATTR-UXMBL          PIC X(01) VALUE 'I'.
   05  ATTR-UXD            PIC X(01) VALUE '<'.
   05  ATTR-UXMD           PIC X(01) VALUE '('.
   05  ATTR-U9N            PIC X(01) VALUE '&'.
   05  ATTR-U9MN           PIC X(01) VALUE 'J'.
   05  ATTR-U9NL           PIC X(01) VALUE 'M'.
   05  ATTR-U9MNL          PIC X(01) VALUE 'N'.
   05  ATTR-U9BL           PIC X(01) VALUE 'Q'.
   05  ATTR-U9MBL          PIC X(01) VALUE 'R'.
   05  ATTR-U9D            PIC X(01) VALUE '*'.
   05  ATTR-U9MD           PIC X(01) VALUE ')'.
   05  ATTR-PXN            PIC X(01) VALUE '-'.
   05  ATTR-PXMN           PIC X(01) VALUE '/'.
   05  ATTR-PXNL           PIC X(01) VALUE 'U'.
   05  ATTR-PXMNL          PIC X(01) VALUE 'V'.
   05  ATTR-PXBL           PIC X(01) VALUE 'Y'.
   05  ATTR-PXMBL          PIC X(01) VALUE 'Z'.
   05  ATTR-PXD            PIC X(01) VALUE '%'.
   05  ATTR-PSN            PIC X(01) VALUE '0'.
   05  ATTR-PSMN           PIC X(01) VALUE '1'.
   05  ATTR-PSNL           PIC X(01) VALUE '4'.
   05  ATTR-PSMNL          PIC X(01) VALUE '5'.
   05  ATTR-PSBL           PIC X(01) VALUE '8'.
   05  ATTR-PSMBL          PIC X(01) VALUE '9'.
   05  ATTR-PSD            PIC X(01) VALUE '@'.
   05  ATTR-PSMD           PIC X(01) VALUE "'".
Advertisements