Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Set ISGRPADMIN field in external database from user.htm property flag

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Set ISGRPADMIN field in external database from user.htm property flag
 Login/Join
 
Member
posted
Hi,

I'm working on migrating users from user.htm files to tables in external repository.
I need to determine if a user is a group admin or not to populate the ISGRPADMIN field in WF_USRGRPTB.

I'm aware that if a user is a group admin the 'gagroups' property is set with those group ids.
I tried posit, substr functions on the USER_PROP field in ibimrusr.txt file generated by mrextract utility, but i'm unable to find out if that particular user is admin to the groups assigned.

Here is the code i tried:
user_prop example:

"inactive,is508,advanced,dataserver,parmrpt,shared,email=testsp@test.com,gagroups=#abc%2c#xyz%2c#efg,dadomains=d1%2d2%2cd3"

FILEDEF ibimrusr DISK &BASELOC/IBIMRUSR.TXT
-RUN

DEFINE FILE ibimrusr
GROUPID/A13 = TRIM('L', GROUP_HREF, 13, '#', 1, 'A13');
STARTG/I3=IF USER_PROP CONTAINS 'gagroups=' THEN (POSIT(USER_PROP,256,'gagroups=',8,'I3')+9) ELSE 0;
F5/A256 = SUBSTR(256,USER_PROP,STARTG,256,256 - STARTG,'A256');
GAGROUP/A256=STRREP (256, F5, 3, '%2c', 1, ',', 256, GAGROUP);
GAGROUP2/A256=STRREP (256, GAGROUP, 1, '#', 0, ',', 256, GAGROUP);

ISGRPADMIN/A1 = IF (GAGROUP2 CONTAINS GROUPID) THEN 'Y' ELSE 'N';
END
-RUN

I think 'CONTAINS' logical operator doesn't work with field comparisons because I get 'N' for all groups.

If I have to use GETTOK function, I'm not sure how to compare to which token as number of groups can vary..

the output I'm trying to achived is:

USERID | GROUPID | ISGRPADMIN
-----------------------------
USER1 abc Y
USER2 123 N


I'd appreciate any help.
Thanks!

This message has been edited. Last edited by: Kerry,


Server:WF 766
Platform: AIX 5.3 pSeries 32on64bit
Desktop: Dev Studio 764
 
Posts: 22 | Registered: July 16, 2008Report This Post
Member
posted Hide Post
Hi,

I'm sorry, I solved this issue using POSIT function. I got really frustrated looking at the problem so posted the issue, but I took a break and realized the obvious solution:

DEFINE FILE ibimrusr
GROUPID/A13 = TRIM('L', GROUP_HREF, 13, '#', 1, 'A13');
LEN/I3 = ARGLEN(13, GROUPID, LEN);
TEST/I3 = POSIT(USER_PROP,256,GROUPID,LEN,'I3');
ISGRPADMIN/A1 = IF TEST NE 0 THEN 'Y' ELSE 'N';
END

That solved my problem.
Thanks.


Server:WF 766
Platform: AIX 5.3 pSeries 32on64bit
Desktop: Dev Studio 764
 
Posts: 22 | Registered: July 16, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Set ISGRPADMIN field in external database from user.htm property flag

Copyright © 1996-2020 Information Builders