Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to find host id from JCL?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to find host id from JCL?
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

Moderator Team Head


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

PostPosted: Fri Jan 22, 2010 12:02 am    Post subject: Reply to: How to find host id from JCL?
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    Post subject:
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: 7931
Location: Bellevue, IA

PostPosted: Fri Jan 22, 2010 12:39 am    Post subject:
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    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Fri Jan 22, 2010 12:56 am    Post subject: Reply to: How to find host id from JCL?
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    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Jan 22, 2010 1:22 am    Post subject: Reply to: How to find host id from JCL?
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: 7931
Location: Bellevue, IA

PostPosted: Fri Jan 22, 2010 1:35 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm
No new posts how to find clist's or view library Andrew Hsia CLIST & REXX 4 Tue Jun 28, 2016 6:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us