Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return code position in storage

Status
Not open for further replies.

KiwiREXXDude

Programmer
May 27, 2003
95
AU
Does anyone know the offsets of the highest return code in a job that can be accessed using the storage function?

I have written a mini batch scheduler using REXX and it's basically a step that runs at the end of a job and sets a completed flag in a dataset. I was hoping to use storage to extract the highest return code as well. Being able to list all step id's and return codes would be better.
 
I don't know that JOBRC is what you're looking for.... I don't even know where I got it -- it's not mine originally:
Code:
/* REXX    JOBRC
*/
numeric digits 20
arg opts; monitor = WordPos("MONITOR",opts) > 0
address TSO
a. = 0 ; c. = "" ; d. = 0 ; x. = 0 ; s. = ""
 
c.psatold  = Storage(21C,4)            /* 4 bytes at offset 540      */
d.psatold  = C2D(c.psatold)
x.psatold  = C2X(c.psatold)
if monitor then say,
   Right("PSATOLD:",12) "C("Right(c.psatold,4)") ",
                        "D("Right(d.psatold,8)") ",
                        "X("Right(x.psatold,8)")"
 
a.tcbjscb  = D2X(d.psatold+183)        /* locn of tcbjscb            */
c.tcbjscb  = Storage(a.tcbjscb,3)      /* 3 bytes at offset 182      */
d.tcbjscb  = C2D(c.tcbjscb)
x.tcbjscb  = C2X(c.tcbjscb)
if monitor then say,
   Right("TCBJSCB:",12) "C("Right(c.tcbjscb,4)") ",
                        "D("Right(d.tcbjscb,8)") ",
                        "X("Right(x.tcbjscb,8)")"
 
a.jscsctp  = D2X(d.tcbjscb+262)        /* locn of jscsctp            */
c.jscsctp  = Storage(a.jscsctp,3)      /* 3 bytes at offset 261      */
d.jscsctp  = C2D(c.jscsctp)
x.jscsctp  = C2X(c.jscsctp)
if monitor then say,
   Right("JSCSCTP:",12) "C("Right(c.jscsctp,4)") ",
                        "D("Right(d.jscsctp,8)") ",
                        "X("Right(x.jscsctp,8)")"
 
exit                                   /*@ JOBRC                     */

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Thanks Frank. I made a job that set a highest return code of 12 and then ran the code after that step then as part of it and didn't get the result I wanted.
 
I don't have access to an MVS system any more, otherwise I'd supply some code. But you really would be much better off getting a tame sysprog to code you up a noddy assembler module, only because IBM supply all the DSECTs for the control blocks that you are chaining through. Although the likelihood of offsets in the PSA changing are pretty remote, the fact that you can use named symbolic references rather than explicit offsets means that you don't have to worry about changes in different MVS releases, you just reassemble it.
 
'tame sysprog'? Such things exist?


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
the fact that you can use named symbolic references rather than explicit offsets means that you don't have to worry about changes in different MVS releases

Hmmmmmmm

c.psatold = Storage(21C,4) /* 4 bytes at offset 540 */

and

a.jscsctp = D2X(d.tcbjscb+262) /* locn of jscsctp */

These look like explicit references to me. ;-)

As for if these offsets changed....I don't know but I do know that an EXEC I had that searched for active address spaces by navigating down control blocks worked fine on MVS and OS/390 but didn't work on z/OS.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top