MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing a step's RC as a parm to a Rexx script

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Wed Oct 17, 2018 1:13 am    Post subject: Passing a step's RC as a parm to a Rexx script Reply with quote

I'm thinking that there must be a simpler way of doing the following.

I have a step in my JCL and would like to pass the return code for that step to the following step in the JCL. For example
Code:

//DELETE   EXEC PGM=IDCAMS                       
//*                                               
//SYSPRINT  DD DUMMY                             
//*                                               
//SYSIN    DD *                                   
 DELETE SIMMIC.DIALLIST.DI.KBN2201               
 SET MAXCC = 12                                   
/*                                               
//*                                               
//         EXPORT SYMLIST=(RETC)                 
//         SET RETC=DELETE.RC                     
//*                                               
//DIT032   EXEC PGM=IKJEFT01                     
//*                                               
//SYSPROC  DD DISP=SHR,DSN=SIMMIC.PRIVATE.CODE   
//*                                               
//SYSTSPRT DD SYSOUT=*                           
//SYSTSIN  DD *,SYMBOLS=JCLONLY                   
%DIVE0001 USER=SIMMIC,RETC=&RETC                 
/*                                               

I've tried all sorts of variations using SYMLIST and EXPORT etc but can't get any of them to actually pass the return code from the previous step to my rexx script. The example above results in the following in SYSTSPRT
Quote:

READY
%DIVE0001 USER=SIMMIC,RETC=DELETE.RC
parms=USER=SIMMIC,RETC=DELETE.RC
READY
END


Any suggestions?
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Wed Oct 17, 2018 1:42 am    Post subject: Reply with quote

Convoluted and messy Mr. Green ................. but you might want to use this in your REXX code and get the RC that way

Code:

/* REXX *** GETRC *** GET THE STEP NAME AND RETURN CODE              */
NUMERIC DIGITS(32)
TCB  = STORAGE(D2X(540),4)
JSCB = STORAGE(D2X(C2D(TCB)+180),4)
JCT  = STORAGE(D2X(C2D(JSCB)+261),3)
THIS_STEP_NO = X2D(C2X(STORAGE(D2X(C2D(JSCB)+228),1)))
FSCT = STORAGE(D2X(C2D(JCT)+48),3)
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)))
  BYPASS = STORAGE(D2X(C2D(TEMP_SCT)+188),1)
  IF X2D(C2X(BYPASS)) = 80
    THEN RCSTEP = 'FLUSHED '
  SAY 'STEP ==>' STEP ' RC ==>' RCSTEP
  TEMP_SCT = STORAGE(D2X(C2D(TEMP_SCT)+36),3)
END
EXIT

_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Wed Oct 17, 2018 5:22 am    Post subject: Reply with quote

Thanks expat - that's the code I have at the moment.

Just seems rather ridiculous that one would have to go to those lengths (not to mention what happens if they ever change the control blocks)
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Wed Oct 17, 2018 6:17 am    Post subject: Reply with quote

Not always the way that you want to do it, but at least it works.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Oct 18, 2018 9:27 am    Post subject: Re: Passing a step's RC as a parm to a Rexx script Reply with quote

misi01 wrote:
I'm thinking that there must be a simpler way of doing the following.


Misi01,

Unfortunately the return code information is available ONLY from control blocks and expat has posted that piece of code. Another alternative is to scan the output of this job and get the IEF142I message from JESYSMSG
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group