Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Passing RC from one JCL to other JCL.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Passing RC from one JCL to other JCL.
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 10, 2009 6:32 pm    Post subject:
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    Post subject: Reply to: Passind RC from one JCL to other JCL.
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 10, 2009 6:43 pm    Post subject:
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    Post subject: Reply to: Passing RC from one JCL to other JCL.
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

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Jun 10, 2009 7:06 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 10, 2009 7:12 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10310
Location: italy

PostPosted: Wed Jun 10, 2009 7:12 pm    Post subject: Reply to: Passing RC from one JCL to other JCL.
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    Post subject: Reply to: Passing RC from one JCL to other JCL.
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts Passing information through JCL as in... Pia Baruah JCL & VSAM 5 Wed May 25, 2016 2:22 pm
No new posts Confusion while passing data to a cal... amitc23 COBOL Programming 5 Mon Mar 07, 2016 12:36 pm
No new posts Passing parms when calling ISRSUPC(su... jasorn COBOL Programming 3 Mon Nov 16, 2015 12:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us