return code of JCL



IBM's Command List programming language & Restructured Extended Executor

return code of JCL

Postby syamcs » Mon Mar 07, 2011 2:58 pm

hi all,
I have a small doubt, is it possible to capture the return code of a JCl using rexx.
syamcs
 
Posts: 56
Joined: Thu Feb 10, 2011 5:36 pm
Location: chennai
Has thanked: 0 time
Been thanked: 0 time

Re: return code of JCL

Postby Akatsukami » Mon Mar 07, 2011 4:02 pm

Yes, but why would you need to? JCL has pretty decent return code/abend/execution facilities itself.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: return code of JCL

Postby syamcs » Mon Mar 07, 2011 4:28 pm

Just want to know it. Can i knw how to capture it :) just give me a hint
syamcs
 
Posts: 56
Joined: Thu Feb 10, 2011 5:36 pm
Location: chennai
Has thanked: 0 time
Been thanked: 0 time

Re: return code of JCL

Postby MrSpock » Mon Mar 07, 2011 6:48 pm

/* 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.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: return code of JCL

Postby syamcs » Tue Mar 08, 2011 4:08 pm

thanks Mr.spocks.... but wat is the input to this rexx code.... or how it can be executed?
syamcs
 
Posts: 56
Joined: Thu Feb 10, 2011 5:36 pm
Location: chennai
Has thanked: 0 time
Been thanked: 0 time

Re: return code of JCL

Postby MrSpock » Tue Mar 08, 2011 4:41 pm

It would normally be run as the last step of a job, so it can capture the return-codes of all of the previous steps,
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: return code of JCL

Postby syamcs » Tue Mar 08, 2011 5:04 pm

thanks MrSpock
syamcs
 
Posts: 56
Joined: Thu Feb 10, 2011 5:36 pm
Location: chennai
Has thanked: 0 time
Been thanked: 0 time

Re: return code of JCL

Postby enrico-sorichetti » Tue Mar 08, 2011 5:04 pm

you were already answered here
clist-rexx/topic5369.html
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: return code of JCL

Postby Marteria » Wed Oct 26, 2011 7:37 pm

Thanks for that link!!A lot of people will be benefited from your writing. Cheers!
Marteria
 
Posts: 1
Joined: Wed Oct 26, 2011 7:36 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post