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

Help in creating files dynamically


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 45
Location: bangalore

PostPosted: Mon Dec 01, 2008 6:08 pm
Reply with quote

Hi,

I need to create files dynamically.
My requirement is to create account files for customers. There can be many number of customers and each customer can have many accounts.

So my job runs each day and I dont know how many customers apply for account details each day and for how many accounts.

Now for each account, I need to create a file. So I need to create file a number of files dynamically.

Can anyone please tell me how to create files dynamically?
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Dec 01, 2008 6:11 pm
Reply with quote

What do you mean by dynamically ? Go for GDG's ...
Back to top
View user's profile Send private message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 45
Location: bangalore

PostPosted: Mon Dec 01, 2008 6:14 pm
Reply with quote

But GDG's can have maximun 255 generations. What if I need more files than that? How do I go about that?
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Dec 01, 2008 6:25 pm
Reply with quote

You can use NOEMPTY for GDG so that once the limit is reached it deletes the oldest version ... this should be done if you do not require the older versions anymore ....

Refer , if you are using enterprise cobol ...

expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci1069896,00.html
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Dec 01, 2008 6:57 pm
Reply with quote

Roshnii wrote:
But GDG's can have maximun 255 generations. What if I need more files than that? How do I go about that?


That's not exactly true. The maximum value for LIMIT is 255. There are four digits available for the generation portion of the GDG (GnnnnVnn) so you can have up to 9999 generations cataloged before the generation value rolls back around to 0001.

See 3.10.2 Absolute Generation and Version Numbers from the z/OS V1R9.0 DFSMS Using Data Sets manual.

However, there are plenty of topic in this forum that show how to dynamically allocate datasets from within a COBOL program.
Back to top
View user's profile Send private message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 45
Location: bangalore

PostPosted: Mon Dec 01, 2008 7:06 pm
Reply with quote

The risk is I dont know what will be the maximum no of files. It may go beyond 9999.
So using GDG's may be a possible risk.
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: Mon Dec 01, 2008 8:03 pm
Reply with quote

Quote:
The risk is I dont know what will be the maximum no of files. It may go beyond 9999.
Uh, you're not designing your system to allocate all of these at one time, I hope? If so, you're going to run into system limits way before you get to 9999 dynamic allocations -- TIOT size limits DD statements per job to 3273, for example.
Back to top
View user's profile Send private message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 45
Location: bangalore

PostPosted: Mon Dec 01, 2008 8:12 pm
Reply with quote

oh. No not at one time.
How do you create GDG's with more than 255 generations. I tried but I cound not do that. The maximum limit is 255.
i am using cobol z/OS 3.4.1 .

Ok, Now I cannot create GDG's ... so what I need is some way of creating file dynmically . Any help icon_sad.gif
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Dec 01, 2008 8:16 pm
Reply with quote

Like I posted previously, there are plenty of existing topics that address the issue of dynamic file allocations in COBOL. Here's a few:

www.ibmmainframes.com/viewtopic.php?t=36069&highlight=dynamic
www.ibmmainframes.com/viewtopic.php?t=35005&highlight=dynamic
www.ibmmainframes.com/viewtopic.php?t=24036&highlight=dynamic
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: Mon Dec 01, 2008 10:22 pm
Reply with quote

Hello,

How large will these user file be? How many files could there be for the same user at the same time? How will these file be used once created?

You might be better served if you created members in a pds rather than separate files for each user. . .
Back to top
View user's profile Send private message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 45
Location: bangalore

PostPosted: Tue Dec 02, 2008 6:55 pm
Reply with quote

Thanks superK for the links. I went through them.

I tried using PUTENV for creating dynamic files and I have a question.

Can i create more than 255 files/ddnames during one run of my program using PUTENV?


dick scherrer,
creating members in a PDS seems to be a nice idea.How do I go about creating members in a PDS.
But here the file length will be 80 only right
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: Tue Dec 02, 2008 9:32 pm
Reply with quote

Hello,

Quote:
But here the file length will be 80 only right
Not necessarily. Many partitioned datasets have 80-byte lengths, but that is so that they are compatible with "card" image control statements, jcl, etc.

One of my pds definitions uses a length of 4096 with no problem.
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top