BPX4GGR (getgroups) example

The following code provides the caller with a list of supplementary group IDs. The code sets BUFW size to 256. The actual BUFW size is determined from the previous BPX4GGR RETVAL when BUFW was 0. For the callable service, see getgroups (BPX1GGR, BPX4GGR) — Get a list of supplementary group IDs. AMODE 31 callers use BPX1GGR (getgroups) example.
                                              
*        MVC   BUFW,=XL4'00000256'   Value of buffer BUFW               
         LA    R15,BUFFERA           Space for BUFW words               
         STG   R15,BUFA              ->Array for group IDs              
         SPACE ,                                                        
         CALL  BPX4GGR,              Get list of supplementary grp IDs +
               (BUFW,                Input: Group ID list size         +
               BUFA,                 ->Buffer for Group ID list address+
               RETVAL,               Return value: -1, 0, ID count     +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               MF=(E,PLIST)          ----------------------------------