## Job step return codes using Rexx

IBM's Command List programming language & Restructured Extended Executor

### Job step return codes using Rexx

The following snipped of code gives me job step name and its return code. But, if there is an abend, then it gives me a odd number instead of abend code. For example, if a job step abended with SD37, it shows the result as below.

STEP ==> ZDLIDB2 RC ==> 67

How to resolve this?

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

shvmudunuru

Posts: 1
Joined: Wed Dec 14, 2011 9:02 pm
Has thanked: 0 time
Been thanked: 0 time