I am using REXX in TSO, and I would like to get information about the Batch job that called the REXX. I was hoping to get the Job name and the job number, but I can't find anything. I've looked in the MVSVAR() and SYSVAR() functions, which is where I thought it'd be available, but couldn't find what I need.
Software/Hardware used:
ASKED:
March 6, 2009 4:07 PM
UPDATED:
March 11, 2009 4:58 PM
Dzs,
Thank you so much for the prompt answer! This really does help. The first call, using the +172, is the one that worked.
Would I be pushing my luck if I asked for help in getting the JOBID as well? I did look at the Beginners article above, and I also found the following site, which lays out the ASCB pretty well, but I couldn’t find JOBID anywhere.
http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.iead100/iea2d18066.htm
So I’m getting the impression from the Beginners article that I could create my own controld block to pass a block of data from one REXX program to another? I’ve always hated having to write data to a file and read it back in from the called program.
Thanks again for your help!
Karl Kanne
I’ve updated the answer with some REXX that will find the JobID for you.
Most high level languages give you facilities to use control blocks, though they may call them something different (like structures in C). So in theory, you could create a control block in one REXX, and pass the address to another one.
The problem is that I’m not aware of any way in REXX to ‘get’ a block of storage for a control block. Some application environments provide other facilities to pass information between REXX programs (like safes and global variables in Netview), but with TSO you’re pretty well stuck with passing parameters, and receiving answers in the RESULT.
Hope this helps,
David
David,
That worked very nice for the job id! Thanks so much for your help!
Karl