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

Dynamic GDG files creation using COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 01, 2009 3:19 pm
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

Moderator Emeritus


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

PostPosted: Wed Jul 01, 2009 7:52 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top