IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To get USER name of a given user ID


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prasannahcp

New User


Joined: 16 May 2005
Posts: 16
Location: Bangalore

PostPosted: Fri Nov 16, 2007 12:33 pm
Reply with quote

Hi,

Can anybody tell me how to get the TSO USER NAME of a given TSO USERID
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Nov 16, 2007 1:29 pm
Reply with quote

I am certain that this has been asked before.

What were your search criteria ?
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Fri Nov 16, 2007 3:52 pm
Reply with quote

Just vague answer :

That information is kept in RACF and I am not sure ( outside RACF ) you can access the User Name on another TSO from your TSO session. Your own, you can via data areas.

Am I right ? not sure !
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Nov 16, 2007 4:15 pm
Reply with quote

Yes you're right:
Quote:

/* nombre del usuario */
ascb = storage(224,4) /* psaaold */
asxb = storage(d2x(c2d(ascb)+108),4) /* ascbasxb */
acee = storage(d2x(c2d(asxb)+200),4) /* acee */
unam = storage(d2x(c2d(acee)+100),4) /* aceeunam */
user_name=strip(storage(d2x(c2d(unam)+1),24))
say user_name
exit
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Nov 16, 2007 4:16 pm
Reply with quote

better using code than quote :


Code:

/* nombre del usuario        */                                   
 ascb = storage(224,4)                             /* psaaold  */
 asxb = storage(d2x(c2d(ascb)+108),4)              /* ascbasxb */
 acee = storage(d2x(c2d(asxb)+200),4)              /* acee     */
 unam = storage(d2x(c2d(acee)+100),4)              /* aceeunam */
 user_name=strip(storage(d2x(c2d(unam)+1),24))                   
 say user_name                                                   
 exit                                                             


;)
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Fri Nov 16, 2007 4:19 pm
Reply with quote

I saw Acevedo was online and give him the opportunity to be considered ( by me at least ) as the King of Data Areas . icon_biggrin.gif
I already helped me before.
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Fri Nov 16, 2007 4:21 pm
Reply with quote

Quote:
I already helped me before.


He already helped me before
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Nov 16, 2007 5:30 pm
Reply with quote

PeD wrote:
I saw Acevedo was online and give him the opportunity to be considered ( by me at least ) as the King of Data Areas . icon_biggrin.gif
I already helped me before.


Ped... thanks for your kindly words but the KingS are Gilbert Saint Flour and Doug Nadel. ;)
Back to top
View user's profile Send private message
prasannahcp

New User


Joined: 16 May 2005
Posts: 16
Location: Bangalore

PostPosted: Mon Nov 19, 2007 2:47 pm
Reply with quote

The above code works well but it gives the user name of the current login user ID. I need the USER NAME of a given USER ID of all the users.
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Mon Nov 19, 2007 3:08 pm
Reply with quote

That is what we told you.
Only your own USER name , or for the others, via RACF or via a inhouse file which contains such info ( here we have that kind of file ).

regards
Pierre
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Mon Nov 19, 2007 7:59 pm
Reply with quote

The RACF database may be unloaded (by your security area) or if you can get READ access. Once unloaded, the 0200 records may be selected off. The VB file will consist of all the "user" records and will have their name and userid:

Code:

//STEP010  EXEC PGM=IRRDBU00,REGION=48M,PARM=NOLOCKINPUT             
//SYSPRINT DD SYSOUT=*                                               
//INDD1 DD  DISP=SHR,                                                 
//          DSN=RACF.DATABASE                                       
//OUTDD DD  DSN=HLQ.RACF.BACKUP,                             
//          DISP=(NEW,CATLG,DELETE),                                 
//          UNIT=SYSDA,SPACE=(CYL,(650,50),RLSE),             
//          DCB=(RECFM=VB,LRECL=4096,BLKSIZE=20480)                   
//****************************************************************** 
//ST0200 EXEC PGM=SORT                                               
//SORTIN   DD DSN=HLQ.RACF.BACKUP,DISP=SHR                   
//SORTOUT  DD DSN=HLQ.RACF.SEL200,                         
//          DISP=(NEW,CATLG,DELETE),                                 
//          UNIT=SYSDA,SPACE=(TRK,(50,15),RLSE),               
//          DCB=(RECFM=VB,LRECL=4096,BLKSIZE=20480)                   
//SYSOUT   DD SYSOUT=*                                               
//SYSIN    DD *                                                       
 SORT FIELDS=COPY                                                     
 INCLUDE COND=(5,4,CH,EQ,C'0200')
/*                                   
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts user exit in IBM Infosphere Optim DB2 8
No new posts Running a Job with the Default User ID JCL & VSAM 2
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
Search our Forums:

Back to Top