I think the JSCBPGMN field of the JSCB is what you're looking for - it holds the job step program name. The JSCB of the current job step is pointed to by the TCBJSCB of the job step TCB (from TCBJSTCB as John said below).

David Stephens
Lead Systems Programmer
[email protected]
www.longpelaexpertise.com.au <http://www.longpelaexpertise.com.au/images/logo.gif>

(Longpela Expertise Logo)
Longpela Expertise - System z Mainframe Consultants
Read new expert Mainframe articles every quarter in our LongEx Mainframe Quarterly <http://www.longpelaexpertise.com.au/ezine>



McKown, John wrote:
Perhaps. In most cases.

Find the excuting TCB from the PSATOLD field of the PSA. From that TCB, find 
the JSTCB by looking at the field TCBJSTCB of the executing TCB (in a 
subtasking environment). From the job step tcb you just got, look at the field 
TCBRBP to find the executing RB. Now, using the field RBLINK in the TCB, find 
the first RB on the chain. You do this by running that chain until the RBLINK 
field of the RB you have is the same as the TCB address you have. This is the 
first RB on the RB chain and usually is the initial program invoked from the 
EXEC PGM=. The one case where it is not, is when the initial load module does 
an XCTL to another module.

Another way is to look at the SWA for the executing step. This is not done with 
chain chasing and will always give you the actual initial program.

John McKown
Systems Engineer IV

IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010

(817) 255-3225 phone * (817)-961-6183 cell

[email protected] * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or 
proprietary information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. 
HealthMarkets(r) is the brand name for products underwritten and issued by the 
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance 
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The 
MEGA Life and Health Insurance Company.SM

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Charles Mills
Sent: Monday, January 18, 2010 9:33 AM
To: [email protected]
Subject: Re: Any idea how a batch pgm (fetchable routine) can find out by which program it was fetched?

Is the name of the jobstep program available somewhere? The name from EXEC
PGM=? That might satisfy the OP.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of McKown, John
Sent: Monday, January 18, 2010 6:20 AM
To: [email protected]
Subject: Re: Any idea how a batch pgm (fetchable routine) can find out by
which program it was fetched?

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Jan Vanbrabant
Sent: Monday, January 18, 2010 3:38 AM
To: [email protected]
Subject: Any idea how a batch pgm (fetchable routine) can find out by which program it was fetched?

Hi,

Question wholly contained in the subject:
Any idea how a batch pgm (fetchable routine) can find out by which program
it was fetched?

By chance no sample or skeleton sample available somewhere?

Jan
No, it is not possible to tell that at all "after the fact".

Example:

load module "A" does a LOAD and load module "B". Module "A" then LINKs to
module "C", passing the address of module "B". Module "C" then does a
BASR/BALR to module "B". No trace of who actually did the LOAD.

Even worse than the above would be if "A" did an XCTL to "C", passing the
address of "B". Now "A" may not even be in the address space any more.

And if LE is involved, like with COBOL or PL/1, then they don't even do the
LOAD, there is an LE subroutine which does it.

--
John McKown Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
[email protected] * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or
proprietary information. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake
Life Insurance Company(r), Mid-West National Life Insurance Company of
TennesseeSM and The MEGA Life and Health Insurance Company.SM

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to