Many thanks for the pointer to the SCT;
using this as keyword and a well known search engine,
I found a REXX (from a french site), which I will try tomorrow.
This could be of interest to others, so here is the REXX (unedited, no
warranty),
including some original french comments:
/* REXX - Recap des Return Code issus des steps d'un JOB */
TCB = ptr(540,4) /* Task Control Bloc IKJTCB>TCBJSCB */
JSCB = ptr(TCB+180,4) /* Job/Step Control Block IEZJSCB>JSCBJCT */
JCT = adj(ptr(JSCB+260,4)) /* Job Control Table IEFAJCTB */
SSIB = adj(ptr(JSCB+316,4)) /* Sub Syst ID Block IEFJSSIB */
StActif = adj(ptr(JSCB+328,4)) /* Step Control Table */
StepRef = adj(ptr(JCT+32,3)) /* IEFAJCTB>JCTSDKAD */
JobName = strip(stg(JCT+8,8)) /* IEFAJCTB>JCTJNAME */
say JobName justify(' ',40) date() time()
queue JobName justify(' ',40) date() time()
IdName = strip(stg(SSIB+0,8)) /* IEFJSSIB>SSIBDEST */
say userid() 'Ident'
queue userid() 'Ident'
UserName = strip(stg(JCT+160,8)) /* IEFAJCTB>JCTUSER8 */
say UserName 'User'
queue UserName 'User'
do 50 /* Limitation aux 50 premiers steps */
if StepRef = 0 ! StepRef = StActif then leave
StepProc = strip(stg(StepRef+44,8))
if StepProc = '' then StepName = strip(stg(StepRef+52,8))
else StepName = StepProc !! '.' !! strip(stg(StepRef+52,8))
PgmName = strip(stg(JSCB+360,8))
StepRC = strip(ptr(StepRef+8,2))
StepRef = adj(ptr(StepRef+20,3))
say ' ' left(StepName,17) 'RC='right(StepRC,2,'0') PgmName
queue ' ' left(StepName,17) 'RC='right(StepRC,2,'0') PgmName
end
PSATOLD = STORAGE(21C,4) /* POINTER TO TCB */
PTRTIOT = STORAGE(D2X(C2D(PSATOLD)+12),4) /* POINTER TO TIOT */
JOBNAME = STORAGE(D2X(C2D(PTRTIOT)),8)
STEPNAME = STORAGE(D2X(C2D(PTRTIOT)+8),8)
PROCNAME = STORAGE(D2X(C2D(PTRTIOT)+16),8)
Tcbjscbb = Storage(D2x(C2d(Psatold)+181),3) /* jscb */
jscbssib = STORAGE(D2X(C2D(tcbjscbb)+316),4) /* Ptr to SSIB */
ssibjbid = STORAGE(D2X(C2D(jscbssib)+12),8) /* job identifier */
ssibid = STORAGE(D2X(C2D(jscbssib)+12),20) /* identifier */
queue JOBNAME SSIBJBID ssibid STEPNAME PROCNAME
"execio * diskw CREXEC (fini"
exit
ptr: return c2d(storage(d2x(arg(1)),arg(2)))
stg: return storage(d2x(arg(1)),arg(2))
adj: if arg(1) = 0 then return arg(1) ; else return arg(1) + 16
Thanks again for your valuable suggestion;
this mailing list is amazing
Bernd
Am 26.11.2018 um 21:41 schrieb Seymour J Metz:
It is relatively easy to retrieve the Step Control Table (SCT) for each step
and check the return code, but I don't know how to do it in a way that IBM will
bless; AFAIK the relevant control blocks are not GUPI.
--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
________________________________________
From: IBM Mainframe Discussion List <[email protected]> on behalf of Bernd
Oppolzer <[email protected]>
Sent: Monday, November 26, 2018 3:29 PM
To: [email protected]
Subject: Compute the maximum return code of all steps (so far)
Hello list,
I have the need to compute (in a C, PL/1 or ASSEMBLER module)
the maximum return code of all prior steps of the running job so far.
This is intended to be the last step of the job and to write the MAXRC
into a DB2 table, which shows the requester the outcome of this
special job (in a series of maybe hundred jobs which he or she
activated by a sort of makefile).
At the moment this is done by a series of steps named RC0, RC4, RC8
and so on, which are activated when the MAXRC falls into the appropriate
range, and then the MAXRC value is written to an ISPF table. I am modifying
this into using a DB2 table, because we had some problems in the past due
to parallel use of the ISPF table involved, which lead to bad situations
(ENQs).
In this context I thought about replacing this bunch of steps by one.
Is this possible? What is needed?
Is there a place where the MAXRC is stored, or is it necessary to retrieve
the RCs of the different steps and compute the MAXRC value myself?
What if one of the steps ABENDed?
It is of course possible to keep the JCL-IF-logic and only replace the
ISPF table by DB2 ... this is what I would do if the computation of the
RCs etc. is too difficult.
Many thanks for your suggestions;
have a nice day.
Bernd
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN