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

How to find host id from JCL?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Thu Jan 21, 2010 11:54 pm
Reply with quote

I have a scenario, some one ran a JCL and which invoked a pgm PXXXX. Now i need to pick up who(Host Id) ran the JCL inside the pgm and display it(or do the processing with it). Is there any register or something like that i can look up to find that out. I know a way using Parm but I am trying to automate this a bit. Let me know if you have any idea on this. Thanks!
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Jan 22, 2010 12:02 am
Reply with quote

I'm not familiar with the term "Host ID". Could you explain a bit more?
Back to top
View user's profile Send private message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Fri Jan 22, 2010 12:27 am
Reply with quote

With Host Id i mean logon id/User Id. The ids which assigned to mainframe users to as the unique identifier.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jan 22, 2010 12:39 am
Reply with quote

If the job card has USER= then you will not be able to tell who submitted the job.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jan 22, 2010 12:48 am
Reply with quote

More finger pointing!
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Jan 22, 2010 12:56 am
Reply with quote

by processing SMF data You can extract all the info needed to determine the userid used to run a <process>
speak to Your support
Back to top
View user's profile Send private message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Fri Jan 22, 2010 1:06 am
Reply with quote

If i don't code USER in the Jobcard, I think RACF assigns automatically the id of user who's submitting it..Right?

How do i read it in the module?
Back to top
View user's profile Send private message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Fri Jan 22, 2010 1:09 am
Reply with quote

With User id i mean TSO SIGNON ID...Sorry but i thought let me clear if i am confusing you with the terms i used.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Jan 22, 2010 1:22 am
Reply with quote

I've got some REXX code snippets that obtain various values from the Control Blocks. Maybe one or two might be useful?

Code:

/*REXX*/                                                           
NUMERIC DIGITS(32)                                                 
TCB=STORAGE(D2X(540),4)                                           
JSCB=STORAGE(D2X(C2D(TCB)+180),4)                                 
SYSJESN=STORAGE(D2X(C2D(STORAGE(D2X(C2D(JSCB)+316),4))+12),8)     
JCT=STORAGE(D2X(C2D(JSCB)+260),4)                                 
SYSJOBN=STORAGE(D2X(C2D(JCT)+24),8)                               
ACT=STORAGE(D2X(C2D(JCT)+56),3)                                   
SYSPGMR=STORAGE(D2X(C2D(ACT)+24),20)                               
ACTL=C2D(STORAGE(D2X(C2D(ACT)+48),1))                             
SYSACCT=STORAGE(D2X(C2D(ACT)+49),ACTL)                             
SAY WORD(SYSJOBN,1)'('SYSJESN') ACCOUNT('SYSACCT')' SYSPGMR       


Code:

***************************** Top of Data *******
/* REXX */                                       
ASCB = C2D(STORAGE(224,4))                       
ASSB = C2D(STORAGE(D2X(ASCB+336),4))             
JSAB = C2D(STORAGE(D2X(ASSB+168),4))             
JBNM = STORAGE(D2X(JSAB+28),8)                   
JBID = STORAGE(D2X(JSAB+20),8)                   
USID = STORAGE(D2X(JSAB+44),8)                   
SAY "JOBNAME="JBNM" JOBID="JBID" USERID="USID   
EXIT 0                                           


Code:

/* Rexx Username                                                      */
/* Obtain user name from data areas                                   */
say get_username()                                                     
exit                                                                   
                                                                       
get_username:                                                           
ascb = storage(224,4)                                      /* psaaold */
asxb = storage(d2x(c2d(ascb)+108),4)                      /* ascbasxb */
                     /* this is USERID(), if you don't need it delete */
asxbuser=strip(storage(d2x(c2d(asxb)+192),8))             /* asxbuser */
                                                          /*___RACF___*/
acee=storage(d2x(c2d(asxb)+200),4)                            /* acee */
                                      /* if you don't need it, delete */
aceegrpn=strip(storage(d2x(c2d(acee)+30),8))              /* aceegrpn */
unam=storage(d2x(c2d(acee)+100),4)                        /* aceeunam */
user_name=strip(storage(d2x(c2d(unam)+1),24))                           
return user_name                                                       
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jan 22, 2010 1:35 am
Reply with quote

The best way is to use the SMF data but it is not available while the job is running. You cannot find this type of data in any register -- you have to load in the address of the TCB, find the address of the JSCB, then the JCT, to find the user id field.at offset 160. Consult your copy of the MVS Data Areas manuals for the appropriate offsets and so forth.
Back to top
View user's profile Send private message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Fri Jan 22, 2010 2:35 am
Reply with quote

Okay..thanks for everyone's help!!
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts access the last host command CLIST & REXX 2
No new posts Find the occurrence of Key Field (Par... DFSORT/ICETOOL 6
No new posts Find a record count/numeric is multip... COBOL Programming 1
Search our Forums:

Back to Top