Just a thought on this. As you say, check that the TCB under which the code is 
executing is the JSTCB. Next, make sure that the RB back chain points back to 
the TCB. This means that it is the only RB on the chain and that you are not 
running via a LINK instruction. But you might be running on the first RB, but 
invoked via a BALR/BASR where the executable code was brought in with a LOAD 
and the EPA stored away. In that case, get the CDE pointer from the RB. The CDE 
contains the load point of the program and its length. Make sure the PSW is 
within this address range. If not, then you were not executed via a PGM= . 
Unfortunately, I cannot figure out an easy way to determine if you were invoked 
via an XCTL.

I guess the OP's question, as I might rephrase it would be: "How can I test to 
see if the currently executing code is being run under the first, and only, RB 
on the TCB's RB chain and that the TCB is the job step TCB?" Answering this 
would eliminate use of ATTACH, LINK, LOAD/BALR|BASR, SYNC. It only leaves XTCL.

-- 
John McKown
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone *
john.mck...@healthmarkets.com * 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:IBM-MAIN@LISTSERV.UA.EDU]
> On Behalf Of Shmuel Metz (Seymour J.)
> Sent: Wednesday, December 05, 2012 9:01 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: Who loaded me?
> 
> In <076601cdd26d$7bc24590$7346d0b0$@mcn.org>, on 12/04/2012
>    at 02:19 PM, Charles Mills <charl...@mcn.org> said:
> 
> >1. What would be the best way for a program running z/OS batch to
> >answer the question "Am I the jobstep program, the PGM= program, or
> was
> >I LOADed and CALLed or ATTACHed (let's ignore XCTL for now) by another
> >program?
> 
> The TCBJSTCB field of the current TCB points to the J/S TCB. The
> Initiator attaches PGM=foo as a jobstep.
> 
> >2. In addition, if the answer to (1.) is "another program," where
> would
> >I find its entry point name?
> 
> Use CSVQUERY to identify the current program.
> 
> >In other words, "who loaded me?"
> 
> Those are two unrelated questions. There is no API to determine who did
> the LOAD for a loaded module.
> 
> Do you also want to know who did a CALL or LINK?
> 
> --
>      Shmuel (Seymour J.) Metz, SysProg and JOAT
>      Atid/2        <http://patriot.net/~shmuel>
> We don't care. We don't have to care, we're Congress.
> (S877: The Shut up and Eat Your spam act of 2003)
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send
> email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to