Solved

Check Group Membership

Posted on 2015-01-30
2
136 Views
Last Modified: 2015-02-02
Is there an easy way to check to see if a user is member of a group within a CL?

I want to check to see if a user is a member of a specific group -- but wasn't sure how exactly to do this.

Any help would be much appreciated.

Thanks!
0
Comment
Question by:Matthew Roessner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
Gary Patterson earned 500 total points
ID: 40580023
Here's a rough example:

DCL &PRIGRP *CHAR 10
DCL &SUPGRP *CHAR 150
DCL &GROUP *CHAR 10 value('QSECOFR')
RTVUSRPRF USRPRF(SOMEUSER) GRPPGM(&GROUP)  SUPGRPPRF(&SUPPLEMENTAL)
IF ((&PRIGRP *EQ &MEMBER) *OR (%SCAN(&GROUP &SUPGRP *NE 0))) THEN DO
...

One note:  &SUPGRP is one big long string containing up to 15 supplemental group profiles.  Each profile starts in a fixed position:  position1, position 11, position 21, etc.  It is technically possible to get a false positive:

Group = 'APR'
Supgrp = 'PROFILE00APROFILE00BPROFILE00C'

%SCAN would find APR in position 10.

So you'll need to get a little fancier in production code: maybe write a little loop that extracts 10 bytes at a time and tests them, or test the position returned by %SCAN to verify that it ends in a "1".
0
 
LVL 1

Author Closing Comment

by:Matthew Roessner
ID: 40583858
Thanks for the direction Gary
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Installing a Printer on AS400 5 201
Free Form Definition specs 3 141
iSeries email authority 6 113
AS400 SDA - french accented letters 3 64
After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
Configuring Remote Assistance for use with SCCM
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question