REXX- To capture Retrun Code - Doubt



IBM's Command List programming language & Restructured Extended Executor

REXX- To capture Retrun Code - Doubt

Postby shamaam2 » Fri Nov 12, 2010 11:23 am

Hi Friends,

I used this below code taken from our site posted by SuperK.

I use this exec to log the return-codes for each step of the job. It runs as the very last step:
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 */
/* 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


Please note that this code is from public-domain freeware, so I take no credit for the content.

JCL for it:

//LASTSTEP EXEC PGM=IRXJCL,PARM='GETRC'
//SYSEXEC DD DISP=SHR,DSN=YOUR.REXX.PARMLIB
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY



This is executing fine, BUt am not able to figure out where the return code is captured... Pleaes help..

And also , Please suggest if anyone knows how to capture the spool details into a file of a submitted job.


Thanks....
shamaam2
 
Posts: 13
Joined: Wed Nov 03, 2010 9:51 am
Has thanked: 0 time
Been thanked: 0 time

Re: REXX- To capture Retrun Code - Doubt

Postby shamaam2 » Fri Nov 12, 2010 4:01 pm

Hi Guys, Thanks a lot for having such forums, Discussions and communities.......

Really Very Helpfull.

ooops.... did a mistake ,after lot of trial and error, solved myself.......


Kudos to u all... :-)
shamaam2
 
Posts: 13
Joined: Wed Nov 03, 2010 9:51 am
Has thanked: 0 time
Been thanked: 0 time

Re: REXX- To capture Retrun Code - Doubt

Postby alexm » Fri Nov 12, 2010 10:24 pm

Regarding "how to capture the spool details into a file of a submitted job";
you may have a look at this redbook: http://www.redbooks.ibm.com/abstracts/sg247419.html or consume this presentation: http://publib.boulder.ibm.com/infocente ... layer.html, both discussing "Implementing REXX Support in SDSF"
User avatar
alexm
 
Posts: 35
Joined: Wed Oct 13, 2010 6:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: REXX- To capture Retrun Code - Doubt

Postby dick scherrer » Sat Nov 13, 2010 1:05 am

Good to hear it is working - thank you for letting us know :)

ooops.... did a mistake ,after lot of trial and error, solved myself.......
It will possibly help someone else if you explain the mistake and the correction. . .

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post