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


A simple mapping application

GDDM V3R2 Base Application Programming Guide
SC33-0867-01



The MAPEX01 program, shown in Figure 81 could be used by an enterprise to record orders for its products made by customers. Initially it displays the fields shown in Figure 83 in topic 15.2.1.

The end user is required to enter a customer number and an invoice number. The program checks that they are numeric. If so, the program does some further processing (not shown here, but it could be, for instance, to display another map for the end user to enter some more information.) If they are not both numeric, the program puts a message on the screen and enables the end user to correct the error. The position of the message (the line below the heading) was defined when the map was created.



MAPEX01: PROC OPTIONS (MAIN);

DECLARE 1 CUSTINV, /* Application Data Structure */ A 10 MESSAGE CHAR(78), A 10 CUSTNO CHAR(5), A 10 INVNO CHAR(4), A ORDER1_ASLENGTH FIXED BIN(31,0) STATIC INIT(87); A DECLARE (ATTYPE,ATVAL) FIXED BINARY(31,0);

CALL FSINIT; /* Initialize GDDM. */ CUSTINV = ''; /* Clear the ADS */ B LOOP: /* Use MSREAD to display the */ /* map, and wait for input. */ CALL MSREAD('ACME00D6', /* Mapgroup */ C 'ORDER1', /* Map */ ORDER1_ASLENGTH, /* Specify length of ADS */ CUSTINV, /* Specify name of ADS */ ATTYPE, /* Set to attention type ... */ ATVAL); /* ... and value by GDDM */ IF ATTYPE=1 & (ATVAL=3 | ATVAL=15) /* Operator pressed end key?*/ THEN GO TO FIN;

IF VERIFY(CUSTNO,'0123456789') = 0 /* Are CUSTNO and */ D & VERIFY(INVNO,'0123456789') = 0 /* INVNO numeric? */ D THEN DO; /* . */ /* Process CUSTNO and INVNO */ E /* . */ /* . */ MESSAGE = ' '; /* Clear any existing message */ F END; ELSE MESSAGE = 'Invalid Number'; /* If CUSTNO or INVNO not */ G /* 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 MAPEX01;


Figure 81. Source code of MAPEX01

Subtopics:

Go to the previous page Go to the next page



Copyright IBM Corporation 1990, 2012