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

Dyanmically invoke JCL step based on prevous output in loop?


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

New User


Joined: 18 Mar 2007
Posts: 44
Location: New Jersey,USA

PostPosted: Fri Apr 04, 2008 2:03 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Apr 04, 2008 2:19 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 04, 2008 2:21 am
Reply with quote

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
View user's profile Send private message
VIGNRSH
Warnings : 1

New User


Joined: 18 Mar 2007
Posts: 44
Location: New Jersey,USA

PostPosted: Fri Apr 04, 2008 2:34 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 04, 2008 2:43 am
Reply with quote

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
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
This topic is locked: you cannot edit posts or make replies. REXX - Do - Not able to LOOP CLIST & REXX 10
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top