Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Check Group Membership

Posted on 2015-01-30
2
Medium Priority
?
171 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 2000 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

688 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