Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Dyanmically invoke JCL step based on prevous output in loop?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Dyanmically invoke JCL step based on prevous output in loop?
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

Moderator Team Head


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

PostPosted: Fri Apr 04, 2008 2:19 am    Post subject: Reply to: Dyanmically invoke JCL step based on prevous outpu
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

Site Director


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

PostPosted: Fri Apr 04, 2008 2:21 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Apr 04, 2008 2:43 am    Post subject:
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    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 Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us