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
 

 

Dynamic GDG files creation using COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
homesh_career

New User


Joined: 25 Aug 2005
Posts: 5

PostPosted: Wed Jul 01, 2009 10:23 am    Post subject: Dynamic GDG files creation using COBOL
Reply with quote

I have a requirement where I need to create no of GDG files based on the data in the input file.

for example - if the input file contains 1000 records then I need to create 10 GDG's containing 100 recs each. If the input file contains 1500 recs then I need to create 15 GDG's.

Please let me know if you have any examples.

Thanks, Homesh
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Jul 01, 2009 11:14 am    Post subject:
Reply with quote

Below pseudo code will give you the way...
Code:

find record count

find loop count i.e. record count/100

open input file.

for 1 to loop count

call writerecs

end_for
close file


write program writerecs such that it will allocate next generation of gdg and write 100 records from input file to it.

To know how to allocated ps dynamically Check this link


Corrections are welcome.. icon_smile.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jul 01, 2009 3:19 pm    Post subject:
Reply with quote

When you say
Quote:
for example - if the input file contains 1000 records then I need to create 10 GDG's containing 100 recs each. If the input file contains 1500 recs then I need to create 15 GDG's.
do you mean you are going to create 10 (15) new generations of one base GDG, or 10 (15) +1 generations of 10 (15) different base GDG names?

Assuming you want to add generations to a single GDG base, I suspect this may be rather more challenging than you realize since the system does an exclusive enqueue on the GDG base name when you create a new generation of a GDG; I don't know if the system recognizes you already have the enqueue when you attempt to dynamically create the second generation.
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: Wed Jul 01, 2009 7:52 pm    Post subject:
Reply with quote

Hello,

Suggest you consider writing code that will read the "driver" file and generate a multiple jobs to be submitted thru the internal reader to be executed serially - one job submitting the next to maintain order.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm


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