CL test for user in group

0 pts.
Tags:
CLP
I need to test for a specific user in a group to allow them access to a menu option in a CL program. I have already created the new group and added users to it. I need help with the actual CL command to test &user in &group. Tks
ASKED: September 22, 2006  12:12 PM
UPDATED: September 25, 2006  9:25 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

DCL VAR(&GRPPRF ) TYPE(*CHAR) LEN(10)
RTVUSRPRF GRPPRF(&GRPPRF)

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • astradyne
    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
    370 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following