Joined: 12 Apr 2012 Posts: 28 Location: LA, California
Hi..
I'm using the following REXX code to get the return codes of the previous steps in the JCL.
However the return code of a step is set to 0, though it had abened abnormally.
The JESMSGLG says the STEP0020B's RC as S04C, but the display statement gives the RC as 0.
Please let me know how to capture the Abended step .
I do not want the RC to be returned as 0, can it atleast be captured as a non zero RC.
Code:
/* REXX GETRC */
/* GET THE STEP NAME AND RETURN CODE */
NUMERIC DIGITS(32) /* ENSURE MAX PRECISION */
TCB = STORAGE(D2X(540),4) /* PSATOLD IN PSA */
JSCB = STORAGE(D2X(C2D(TCB)+180),4) /* TCBJSCB IN TCB */
JCT = STORAGE(D2X(C2D(JSCB)+261),3) /* JSCBJCTA IN JSCB */
THIS_STEP_NO = X2D(C2X(STORAGE(D2X(C2D(JSCB)+228),1)))
/* THIS STEP NO. */
FSCT = STORAGE(D2X(C2D(JCT)+48),3) /* JCTSDKAD IN JCT */
SAY 'FSCT 'FSCT /* MY */
SAY 'JCT 'JCT /* MY */
/* IS FIRST SCT */
TEMP_SCT = FSCT
DO I = 1 TO (THIS_STEP_NO - 1)
STEP = STORAGE(D2X(C2D(TEMP_SCT)+68),8)
RCSTEP = X2D(C2X(STORAGE(D2X(C2D(TEMP_SCT)+24),2)))
/* SCTSEXEC IN SCT */
BYPASS = STORAGE(D2X(C2D(TEMP_SCT)+188),1)
IF X2D(C2X(BYPASS)) = 80 THEN /* CHECK IF STEP WAS NOT EXECUTED */
DO
RCSTEP = 'FLUSHED '
END
SAY 'STEP ==>' STEP ' RC ==>' RCSTEP
TEMP_SCT = STORAGE(D2X(C2D(TEMP_SCT)+36),3)
END
EXIT
Joined: 12 Apr 2012 Posts: 28 Location: LA, California
Thanks everyone for the Reply.
The problem is that i do not know much about the data area that are referred in this program.
@pedro.
Thanks a lot for the Poniter, (MVS Data Areas , Volume 5 (MCSOP-SPT)) , this book was just awesome.
But still i couldnt use the SCTXABCC field, since i dint how to get to that location of the Data Area.
If you can help me on that it would be of great use.
Thanks.
@parsesource
Your info was just necessary to help me find out the solution, Got the CONDCODE script and used it, Presto. It worked like i wanted . Used the same got my issue resolved.
@jon_s_rice
Thanks for investing time to send that code. Yet to execute them and test it. Will let you know.