How to fetch USER ID in rexx ?



IBM's Command List programming language & Restructured Extended Executor

How to fetch USER ID in rexx ?

Postby Balamurugan3 » Thu Feb 25, 2010 1:57 pm

Hi .... I need to fetch USER ID in which the user has logged in ... by using rexx.... Can any help me in finding it out... I have an requirement where i need to allocate a dataset... depending upon different environment user logs in... Diff env has diff user ID.... So Can anyone suggest a solution....

many thanks..... Bala....
Many Thanks,
Bala
Balamurugan3
 
Posts: 17
Joined: Tue Sep 29, 2009 11:23 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to fetch USER ID in rexx ?

Postby expat » Thu Feb 25, 2010 3:30 pm

Click HERE to read the correct manual.
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: How to fetch USER ID in rexx ?

Postby Robert Sample » Thu Feb 25, 2010 5:19 pm

The user id, unless there is something site specific being used, does not tell you what the environment is. Google is your friend -- you can find REXX code to do this on the Internet.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: How to fetch USER ID in rexx ?

Postby Pedro » Thu Mar 11, 2010 10:28 am

Rather than userid, use the user's prefix. It might not be the same as the userid.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: How to fetch USER ID in rexx ?

Postby Bala1 » Tue Apr 06, 2010 8:58 pm

Hi Bala,

I am not sure if the following sample could help you. I would suggest you to just pull the userid and depending on the environment and the user id the RACF would allow the creation of files. You can hard code the initial qualifiersbased on the same and then pass to the subsequent rexx code or JCL....


**************************************************************
/*REXX*/
str=userid()
select
when substr(str,1,2)="PRD" then
do
HQL1=PROD
HQL2=PRD
end
when substr(str,1,2)="TST" then
do
HQL1=TEST
HQL2=TST
end
when substr(str,1,2)="DEV" then
do
HQL1=DEVE
HQL2=DEV
end
end

******************************************************************
In the example dependign on the nature of the ids (production,test, dev) the first 2 qualifiers are hard coded.


cheers,
Bala
_____________________
Cheers,
Bala
Bala1
 
Posts: 15
Joined: Tue Apr 06, 2010 7:07 pm
Location: London, United Kingdom
Has thanked: 0 time
Been thanked: 0 time

Re: How to fetch USER ID in rexx ?

Postby expat » Wed Apr 07, 2010 11:52 am

Bala1

I would bet a penny to a pound that you did not test that code before posting it, because there is no way on earth that a substr(var,1,2) would EVER match a three character string.
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: How to fetch USER ID in rexx ?

Postby Bala1 » Fri Apr 09, 2010 4:19 pm

Hi expat,
I am really sorry it should have been substr(var,1,3) to validate 3 strings. It was a typo... I should have tested the code. Going forward would make sure that i have executed once and then post the solution.

My apologies for any confusion caused. but the logic can be used i believe.

Cheers,
Bala
_____________________
Cheers,
Bala
Bala1
 
Posts: 15
Joined: Tue Apr 06, 2010 7:07 pm
Location: London, United Kingdom
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post