Solved

Check Group Membership

Posted on 2015-01-30
2
114 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
2 Comments
 
LVL 34

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iSeries ODBC Exit Point 11 392
DB2 return first match 3 103
IBM 840 flash storage Array 3 157
AS/400 created the PO exchange server sends the email 5 73
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Knowledge base software has turned out to be a quite reliable method for storing information, promoting collaborative work and for sharing valuable input and solutions.However, some organizations are trying to develop a knowledge base that works wit…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now