View previous topic :: View next topic
|
Author |
Message |
anilkumar922
New User
Joined: 27 Jun 2016 Posts: 13 Location: india
|
|
|
|
Hi All,
I've one requirement like based on no.of records in file, i need to execute next step that many times.
For Ex: if my file has 2 records, then next step should execute two times. if it has one then it should execute only 1 time.
Please let me know how we can achieve this scenario?
Thanks in Advance. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
You can't, you will need a program to do that. |
|
Back to top |
|
|
anilkumar922
New User
Joined: 27 Jun 2016 Posts: 13 Location: india
|
|
|
|
You mean REX program? |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
No, I mean a program, whatever you prefer - Asembler, COBOL, PL/I, REXX..... |
|
Back to top |
|
|
anilkumar922
New User
Joined: 27 Jun 2016 Posts: 13 Location: india
|
|
|
|
Thanks Willy Jensen.
Could you please give me outline how we can implement this logic in COBOL. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
We are not here to design things for you. Get together with your team lead to discuss and design. Hint: internal reader. |
|
Back to top |
|
|
anilkumar922
New User
Joined: 27 Jun 2016 Posts: 13 Location: india
|
|
|
|
Thanks Nic for your valuable suggestion. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
REXX would seem the logical choice, been there, done that when a regression testing job became so large that it exceeded the very hard limit of 255 steps in a job. The job now has a single step running a REXX exec that loops around, and gets its parameters from the name(!) of a JCL file, the job is submitted by an edit macro that dynamically changes this dsname. |
|
Back to top |
|
|
tatasteed
New User
Joined: 18 Sep 2007 Posts: 8 Location: Santiago de Chile
|
|
|
|
You can do it by means of an instream proc.
You just need to pass the parameters to the instream proc by means of an include call (I have done so a few times).
Using sort is a good way to build the include. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
I have used a REXX EXEC which reads each record, in this case it was about 80 bytes, and passed it as a parameter into a program called by REXX.
So for every record read the program was invoked. |
|
Back to top |
|
|
|