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

Passing RC from one JCL to other JCL.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Wed Jun 10, 2009 6:27 pm
Reply with quote

Hi All,

I have a PDS with two jobs:
Code:


JCL1 :
JCLSTEP1

JCL2:
JCLSTEP2



JCLSTEP1 is a seperate job which contains the REXXCODE. I want to use the return code from the rexx code to run the next job (JCLSTEP2).

If anyone has solution Please share it.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 10, 2009 6:32 pm
Reply with quote

Your question is not clear.
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Wed Jun 10, 2009 6:39 pm
Reply with quote

Hi,

I have a PDS having Two different JCL,

JCL1 - This JCL is used to run the Rexx code

JCL2 - This JCL is used to run a cobol Code

I wants to run the JCL2 based on the return code from Rexx code (JCL1).
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 10, 2009 6:43 pm
Reply with quote

Yes, I managed to suss that part out from the original post.

Under what conditions do you want to run the second job,
How do you propose to submit the second job,
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Wed Jun 10, 2009 7:04 pm
Reply with quote

Only If the RC from the Rexx code is 0. I want to run the next Step(i.e. JCL2).
*******************************************
I want to have both the JCL in a same member as,

//STEP01 EXEC JCL1
//*
//STEP02 EXEC JCL2
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Jun 10, 2009 7:06 pm
Reply with quote

Maybe use a scheduling package to specify the conditions for executing JCL2 ?

If your REXX is setting the return code, you could pass it via dataset.

Garry.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Jun 10, 2009 7:12 pm
Reply with quote

Combine step1 and step2 into 1 job and use an IF check to determine if step2 should be run. Elementary JCL coding.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 10, 2009 7:12 pm
Reply with quote

OK, lets start from the beginning here.

I can only assume that the steps shown above are PROCs NOT JOBS as previously stated, because of the way that they are coded.

So you only want JCL2 to process if JCL1 gives a return code of 0.

How many steps are there in JCL1, and if there are more than one then is the condition that every step must return zero.

You can look at the JCL reference manual - reached easily by the "IBM Manuals" button at the top of each page, and look for COND or IF/THEN/ELSE

Then you can test it yourself, and if you still have issues to post those issiues on the forum.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jun 10, 2009 7:12 pm
Reply with quote

once You have clarified Your requirements we might help

but the easiest approach seems to be

ONE JOB, MANY STEPS with the usual condition code checking,
better if done using the IF/THEN/ELSE logic
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Mon Jun 15, 2009 6:41 pm
Reply with quote

Hi All,

I have got Solution for this,

This is my requirement,

In a JCL i have got two proc's like,

Code:


//step01 exec xxxxxxxx /* This Proc contains Rexx Code*/
//step02 exec yyyyyyyy/*This Proc contains cobol code*/



I have tried using so many ways finally i embedded both the Proc's using Rexx like,

Code:


STATUS = MSG('OFF')                                                   
SUBDSN = ACID || '.aaaaaa.bbbbb' /* Temp dataset name */                                   
ADDRESS TSO                                                           
/************************* SUBMIT **************************/         
   "ALLOC FI(OUTFILE) DA("SUBDSN") NEW SPACE(5 5) TRACKS ",           
     "DSORG(PS) RECFM(F,B) LRECL(80) UNIT(DEVDA) REUSE"               
DELSTACK                                                               
QUEUE "//" || ACID || "X JOB (,J3),'jOB NAME',MSGCLASS=X,CLASS=B,"     
QUEUE "//"            "NOTIFY=&SYSUID"                                 
QUEUE "//PROCLIB  JCLLIB ORDER=PROCLIB NAME"       
QUEUE "//JOBLIB   DD DSN=LOADLIB NAME"   
QUEUE "//STEP01 EXEC pROC mEMBER"                                       
   "EXECIO * DISKW OUTFILE (FINIS)"                                   
   SUBMIT SUBDSN                                                       
   DELETE SUBDSN                                                       
RETURN                     



I have used the return code from first proc to run my second using if Condition.

Thank you all for posting.!!!
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 Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts Passing SYSPRINT to Invoked Program PL/I & Assembler 9
No new posts Passing parm from JCL to Assembler, b... PL/I & Assembler 2
No new posts passing symbolic parameters through d... JCL & VSAM 3
No new posts passing stem variable with VPUT/VGET ... CLIST & REXX 6
Search our Forums:

Back to Top