Understanding Group ID Exit Name processing

When the Group ID Exit Name is called, the DB2 UDB Option for CICS passes the exit program a 4012-byte communication area into which the exit program can build a list of up to 500 8-byte group IDs.

The format of the communication area is:

COMMAREA   DSECT
 COUNT     DS     F
 USERID    DS     CL8
 ENTRIES   DS     500CL8

The COUNT field contains the number of entries in the list including the original user ID. ENTRIES can contain a list of 500 8-byte group IDs.

The communication area comes with an entry for USERID already specified. The COUNT field contains 1. The exit program can perform one of these actions:

In this example, two group IDs (GROUP1 and GROUP2) are added to the list:

EXITPROG  DFHEIENT
          USING   COMMAREA,R2
          L       R2,DFHEICAP
          MVC     COUNT,=F'3'
          MVC     ENTRIES+08(08),=CL8'GROUP1'
          MVC     ENTRIES+16(08),=CL8'GROUP2'
          EXEC CICS RETURN
          LTORG
          DFHEISTG
 COMMAREA DSECT        
 COUNT    DS      F
 ENTRIES  DS      501CL8
       END