View previous topic :: View next topic |
Author |
Message |
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Wed Oct 17, 2018 1:13 am Post subject: Passing a step's RC as a parm to a Rexx script |
|
|
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 |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Wed Oct 17, 2018 1:42 am Post subject: |
|
|
Convoluted and messy ................. 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 |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Wed Oct 17, 2018 5:22 am Post subject: |
|
|
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 |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Wed Oct 17, 2018 6:17 am Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Oct 18, 2018 9:27 am Post subject: Re: Passing a step's RC as a parm to a Rexx script |
|
|
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 |
|
|
|
|