View previous topic :: View next topic
|
Author |
Message |
Vigneshwaran S Warnings : 1 New User
Joined: 10 Dec 2008 Posts: 60 Location: Chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Your question is not clear. |
|
Back to top |
|
|
Vigneshwaran S Warnings : 1 New User
Joined: 10 Dec 2008 Posts: 60 Location: Chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Vigneshwaran S Warnings : 1 New User
Joined: 10 Dec 2008 Posts: 60 Location: Chennai
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Vigneshwaran S Warnings : 1 New User
Joined: 10 Dec 2008 Posts: 60 Location: Chennai
|
|
|
|
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 |
|
|
|