GDDM V3R2 Base Application Programming Guide
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF | BOOK


Specifying a PF key for alphanumeric input

GDDM V3R2 Base Application Programming Guide
SC33-0867-01



The program end user's input is sometimes one of a number of predetermined character strings. GDDM provides a facility to save the end user having to type such strings. It is called AID translation. Its effect is to put a character string into a field when a PF key, or any other interrupt-generating key, such as a PA or the ENTER key, is pressed. In other words, GDDM translates an attention identifier (AID) into a character string.

You do all the necessary work when you define the map. Full details are given in GDDM Interactive Map Definition book. Briefly, you first define one or more tables that associate character-string values with selected PF keys. You do this using the GDDM-IMD table editor. Then, using the Application Data Structure Review frame of the map editor, you specify a table or tables to be associated with one or more fields in the map.

The receiving field for an AID translation string need not appear on the screen. You can simply add it to the ADS using GDDM-IMD's ADS Review frame.

When the map is displayed on the screen, and the end user presses a PF key, GDDM looks up each table specified for the map, to check if a character string has been specified for that PF key. Each field for which such a table has been specified has the associated character string inserted into it by GDDM.

The result is the same as if the end user had typed the character strings into the fields. The application has no way of telling that AID translation was used. Any selectors, and the parameters of ASREAD, return the same values as if the end user had typed the data into the field.

If your program needs to discover which PF key was pressed, it should inspect the values returned in the parameters of ASREAD. Whether or not AID translation was in use, these indicate which key caused the interrupt that satisfied the ASREAD.

In addition to PF keys, you can set up AID translation for any terminal facility that causes an interrupt, such as the CLEAR key or a magnetic card reader. The method is the same as for PF keys.


MAPEX09: PROC OPTIONS (MAIN);

DECLARE 1 CUSTINV, /* Application Data Structure */

10 USER_FIELD CHAR(3), 10 MESSAGE CHAR(78), 10 CUSTNO CHAR(5), 10 INVNO CHAR(4), ORDER1_ASLENGTH FIXED BIN(31,0) STATIC INIT(90); DECLARE (ATTYPE,ATVAL) FIXED BINARY(31,0); INIT(90); CALL FSINIT; /* Initialize GDDM. */ CUSTINV = ''; /* Clear the ADS */ LOOP: /* Use MSREAD to display the */ /* map, and wait for input. */ CALL MSREAD('ACME00D6', /* Mapgroup. */ 'ORDER1', /* Map. */ ORDER1_ASLENGTH, /* Specify length of ADS. */ CUSTINV, /* Specify name of ADS. */ ATTYPE, /* Set to attention type ... */ ATVAL); /* ... and value by GDDM */

IF USER_FIELD='END' /* If PF key 3 or 15 pressed, */ THEN GO TO FIN; /* end the program. */ IF VERIFY(CUSTNO,'0123456789') = 0 /* Are CUSTNO and */ & VERIFY(INVNO,'0123456789') = 0 /* INVNO numeric? */ THEN DO; /* . */ /* Process CUSTNO and INVNO */ /* . */ /* . */ MESSAGE = ' '; /* Clear any existing message */ END; ELSE MESSAGE = 'INVALID NUMBER'; /* If CUSTNO or INVNO not */ /* numeric, set up message.*/ GO TO LOOP; /* Redisplay the map and data.*/

FIN: CALL FSTERM; /* Terminate GDDM. */

%INCLUDE ADMUPINF; /* GDDM entry declarations. */ %INCLUDE ADMUPINM;

END MAPEX09;


Figure 93. Listing of MAPEX09 source code


An example of using AID translation is shown in Figure 93. It is the same program as the one shown in Figure 81 in topic 15.2, except that after receiving correct input, it redisplays the map, instead of terminating.

To terminate, the end user presses PF3 or PF15. An AID table was set up using the GDDM-IMD table editor, in which the character-string value END was associated with PF3 and PF15. Using the ADS Review frame of the map editor, this table was associated with the field called USER_FIELD. The result is that either PF3 or PF15 puts the character string END in this field. No field corresponding to USER_FIELD appears on the screen.

Go to the previous page Go to the next page



Copyright IBM Corporation 1990, 2012