View previous topic :: View next topic
|
Author |
Message |
VIGNRSH Warnings : 1 New User
Joined: 18 Mar 2007 Posts: 44 Location: New Jersey,USA
|
|
|
|
Hi ,
I have a requirement , where i have to invoke a JCL step with data from prevoius step and also execute the JCL step for all the records output from previous step.
For Ex:
Step1: Sort step
which outputs 10 records to file1
Step2: Executing a Program has to be invoked for 10 times.Since the program which is executed in this step can accept only one record at a time.
Pls guide ! |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
The most reasonable solution is to have a driver program in STEP2 that invokes the other program 10 times. Other than that, I see you either coding 10 steps like STEP2 (STEP2A, STEP2B, etc.) that all do the same thing, having STEP2 call a PROC with 10 steps, or having STEP2 invoke another job, and then that job invoking itself another 9 times. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Don't use the sort.
Write a bit of code that reads the "input" and generates a new job to submit thru the internal reader. This generated job would have as 10 steps as there were 10 records on the input file.
There are multiple topics on using the internal reader in the forums. If you read an internal reader topic and have questions, please post the part of the topic that you don't understand and your question about it. |
|
Back to top |
|
|
VIGNRSH Warnings : 1 New User
Joined: 18 Mar 2007 Posts: 44 Location: New Jersey,USA
|
|
|
|
Hi,
I have understood INTRDR ,
But suppose for ex,
Step 1 : o/p is
list of accounts.
1000
2000
3000
4000
Now i have to pass first 1000, to step2
and read 2000 and invoke Stpe2 again.
and then read 3000 and again invoke step 3. and so on.
I do not know , how many reocrds will get generated in first step.
So i cannnot code fixed number of steps beforehand.
The problem with INTRDR i tried is that ,
i could pass first value 1000 to JCL of step2.
but could not read again 2000 and invoke step2.
Pls notify how can i go about this and solve .
Thanks in advance. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You would generate one step for each record read - a step for the record with 1000, a step for the record with 2000, etc.
I don't know why you would need to "read again". The input would be read one time and a new step generated for each value.
Keep in mind to generate one job with multiple steps there is the restriction that you can have a maximum of 255 steps (IIRC) in a single job. |
|
Back to top |
|
|
|