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: 7996
Location: Bellevue, IA

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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


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