Page 1 of 1

How to Execute 1 Step of JCL more than 1 time ?

PostPosted: Fri May 09, 2008 2:25 pm
by denis.dhimitri
Hello Mr.Yaeger,

I'm here again with a new question for you. I've to build a JCL which has to execute the second STEP for n-times where n = number of OUTPUT files of the first STEP that creates them dynamically. How can I do something like this ? I mean how can I loop in the second STEP of my JCL ? Thanks in advance.

Regards
Denis Dhimitri

Re: How to Execute 1 Step of JCL more than 1 time ?

PostPosted: Fri May 09, 2008 6:20 pm
by CICS Guy
denis.dhimitri wrote:I've to build a JCL which has to execute the second STEP for n-times where n = number of OUTPUT files of the first STEP that creates them dynamically. How can I do something like this ? I mean how can I loop in the second STEP of my JCL ?
Step one can create (almost) any number of step twos, but those steps will be executed in another JOB (or JOBs).
You can't loop within a job.

Re: How to Execute 1 Step of JCL more than 1 time ?

PostPosted: Fri May 09, 2008 8:53 pm
by Frank Yaeger
This is not a DFSORT question. I'm moving it to the JCL Forum so somebody else can answer it (I'm an expert on DFSORT, but not on JCL).

Re: How to Execute 1 Step of JCL more than 1 time ?

PostPosted: Sat May 10, 2008 12:58 am
by William Thompson
denis.dhimitri wrote:I've to build a JCL which has to execute the second STEP for n-times where n = number of OUTPUT files of the first STEP that creates them dynamically. How can I do something like this ? I mean how can I loop in the second STEP of my JCL ?
Like CG said, not within the same job.
You could use REXX, COBOL or Sort to create the JCL for the following variable job.
You may be remembering cases where one sort/tool step created input data for a second step, but I've never seen JCL created for a second step.

Re: How to Execute 1 Step of JCL more than 1 time ?

PostPosted: Mon May 12, 2008 4:18 pm
by jayind
To my knowledge and FYI...

JCL is a fall through of executable statements... Its kind of interpreter and execution. You cant go back to re-execute some step that already either executed or by passed in the process of fall through. This can happen only creating another JCL with so many steps using COBOL or REXX and submit as successor to the current JCL. Hope this helps....