


You need to retrieve and test the group and supplemental groups for the user and check these to see if they contain the group you are interested in. The following CL programs returns a '1' if the group is found and a '0' if not:
PGM PARM(&p1USER &p1GRP &p1RTNC)
DCL VAR(&P1USER) TYPE(*CHAR) LEN(10)
DCL VAR(&P1GRP) TYPE(*CHAR) LEN(10)
DCL VAR(&P1RTNC) TYPE(*CHAR) LEN(10)
DCL VAR(&PRFGRP) TYPE(*CHAR) LEN(10)
DCL VAR(&PRFSUP) TYPE(*CHAR) LEN(150)
DCL VAR(&POS) TYPE(*DEC) LEN(3 0) VALUE(0)
/* 1) Retrieve user's group and supplemental group... */
RTVUSRPRF USRPRF(&P1USER) GRPPRF(&PRFGRP) +
SUPGRPPRF(&PRFSUP)
/* 2) If the passed Group matches either the user's group or */
/* is contained in the supplemental group then we can return */
/* a valid condition... */
CHGVAR VAR(&P1RTNC) VALUE('0')
IF COND(&P1GRP *EQ &PRFGRP) THEN(DO)
CHGVAR VAR(&P1RTNC) VALUE('1')
ENDDO
ELSE CMD(DO)
CALL PGM(QCLSCAN) PARM(&PRFSUP 150 1 &P1GRP 10 +
0 0 '*' &POS)
IF COND(&POS *GE 1) THEN(CHGVAR VAR(&P1RTNC) +
VALUE('1'))
ENDDO
ENDPGM
Hope it helps
Jonathan
DCL VAR(&GRPPRF ) TYPE(*CHAR) LEN(10)
RTVUSRPRF GRPPRF(&GRPPRF)



