Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Looping in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
anilkumar922

New User


Joined: 27 Jun 2016
Posts: 13
Location: india

PostPosted: Tue Feb 25, 2020 7:18 pm    Post subject: Looping in JCL
Reply with quote

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

Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 362
Location: Denmark

PostPosted: Tue Feb 25, 2020 7:38 pm    Post subject:
Reply with quote

You can't, you will need a program to do that.
Back to top
View user's profile Send private message
anilkumar922

New User


Joined: 27 Jun 2016
Posts: 13
Location: india

PostPosted: Tue Feb 25, 2020 7:42 pm    Post subject: Reply to: Looping in JCL
Reply with quote

You mean REX program?
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 362
Location: Denmark

PostPosted: Tue Feb 25, 2020 7:46 pm    Post subject:
Reply with quote

No, I mean a program, whatever you prefer - Asembler, COBOL, PL/I, REXX.....
Back to top
View user's profile Send private message
anilkumar922

New User


Joined: 27 Jun 2016
Posts: 13
Location: india

PostPosted: Tue Feb 25, 2020 7:55 pm    Post subject: Reply to: Looping in JCL
Reply with quote

Thanks Willy Jensen.

Could you please give me outline how we can implement this logic in COBOL.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2365
Location: Hampshire, UK

PostPosted: Tue Feb 25, 2020 9:03 pm    Post subject: Reply to: Looping in JCL
Reply with quote

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

New User


Joined: 27 Jun 2016
Posts: 13
Location: india

PostPosted: Tue Feb 25, 2020 9:13 pm    Post subject: Reply to: Looping in JCL
Reply with quote

Thanks Nic for your valuable suggestion.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1206
Location: Vilnius, Lithuania

PostPosted: Wed Feb 26, 2020 4:05 am    Post subject:
Reply with quote

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

New User


Joined: 18 Sep 2007
Posts: 8
Location: Santiago de Chile

PostPosted: Fri Jun 05, 2020 5:56 am    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8795
Location: Welsh Wales

PostPosted: Fri Jun 05, 2020 2:08 pm    Post subject:
Reply with quote

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
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 Looping in JCL prowlersden CLIST & REXX 20 Tue Feb 11, 2020 5:40 pm
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
No new posts Looping in REXX and pass data to JCL. PeterHolland CLIST & REXX 24 Wed Jan 11, 2012 6:08 pm
No new posts JOIN UNPAIRED looping with 3 key fiel... madmartinsonxx DFSORT/ICETOOL 7 Thu Jul 21, 2011 7:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us