IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we get the return code of a job in some variable


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
MikeHunter

New User


Joined: 02 Aug 2006
Posts: 2

PostPosted: Tue Feb 21, 2012 3:48 pm
Reply with quote

What about:

Code:

/* REXX GETMAXRC                                  */                   
/* 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                                         
MAXRC = 0 
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                               
  IF RCSTEP > MAXRC THEN MAXRC = RCSTEP
  TEMP_SCT = STORAGE(D2X(C2D(TEMP_SCT)+36),3)                         
END   
SAY 'MAXRC ==>' MAXRC                                                               
EXIT
RETURN
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 21, 2012 3:57 pm
Reply with quote

nice try Mike icon_wink.gif

The topic has been resurrected after
Code:
...          3 year(s) - (months difference / 12 )
...          4 year(s) - (difference )
...         42 months
...       1273 days
...      30570 hours
...    1834203 minutes
...  110052180 seconds


but... the guinnes is still this one
www.ibmmainframes.com/viewtopic.php?t=146&highlight=guinness
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Feb 21, 2012 6:51 pm
Reply with quote

I wonder, Mike had been here since 2006 and original discussion started mid 2005 and the latest post is in 2012 - something does not match up here...



PS.: Don't read Sherlock Holmes while going to sleep... icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top