Barry -

Sorry for the empty reply earlier (finger-check). You are definitely on the 
right track. ASXBFTCB is the first TCB on a TCB queue for the address space, 
which is likely the RCT (Region Control Task). For the 'average' batch job you 
have to drill down to the fourth or fifth TCB in the queue to get to the 
jobstep TCB. Just follow the TCBTCB field (offset 116 in the TCB) for each 
successive TCB until you find the jobstep TCB (or hex zeros at the end). You 
can identify it by looking at the TIOT associated with each TCB to see if the 
JOBNAME in the respective TIOT matches the jobname. If you are working with an 
SMF exit, you can get the jobname from either the JMR or the Common Exit 
Parameter list which contains a copy of the JMR. All the preceeding TCBs/TIOTs 
contain jobnames of either MSTJCL00 or INIT.

I just completed work on an IEFUTL module where I needed to interrogate the 
jobstep DDs looking for tape devices which required this approach. I'm working 
on z/OS 1.10 and 1.12 systems. Let me know if I can be of further assistance.

 Frank. 

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of 
Schwarz, Barry A
Sent: Monday, August 29, 2011 8:53 AM
To: [email protected]
Subject: CA-1 TMSXITJ

We are migrating our CA-1 TMSXITJ accounting exit from OS/390 (where it was 
called TMSUX2J) to z/OS 1.11.  The exit needs to find the TCB for the batch job 
mounting the tape.  What has worked in the past is

         USING PSA,R0
         L     R3,PSAAOLD
         USING ASCB,R3
         L     R3,ASCBASXB
         USING ASXB,R3
         L     R3,ASXBFTCB
         USING TCB,R3

Unfortunately, under z/OS it produces the address of a random TCB.  We tried 
changing the code to obtain the TCB address directly from PSATOLD but that 
doesn't seem to be working either.

As part of our debugging we added some WTOs.  Since the messages showed up in 
the job log, we assume the exit is running in the batch job's address space.  
Surely there is way for a job to find it's own TCB?

----------------------------------------------------------------------
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