View previous topic :: View next topic
|
Author |
Message |
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I'm not familiar with the term "Host ID". Could you explain a bit more? |
|
Back to top |
|
|
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
With Host Id i mean logon id/User Id. The ids which assigned to mainframe users to as the unique identifier. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
If the job card has USER= then you will not be able to tell who submitted the job. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
More finger pointing! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
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 |
|
|
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
Okay..thanks for everyone's help!! |
|
Back to top |
|
|
|