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

Splitting a file based upon volume of data


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Tue Sep 07, 2010 1:12 pm
Reply with quote

Hi,

I have a requirement like this:

I/P file:
Code:

STORE1    XXXX
STORE1    XXXX
STORE1    XXXX
STORE1    XXXX
STORE2    XXXX
STORE2    XXXX
STORE3    XXXX
STORE3    XXXX
STORE3    XXXX
STORE3    XXXX
STORE3    XXXX
STORE4    XXXX
STORE4    XXXX
STORE4    XXXX
STORE4    XXXX
STORE4    XXXX
STORE4    XXXX
STORE4    XXXX
STORE5    XXXX
STORE5    XXXX
STORE6    XXXX
STORE6    XXXX
STORE7    XXXX
STORE8    XXXX
STORE8    XXXX
STORE8    XXXX
STORE8    XXXX
STORE8    XXXX
STORE8    XXXX
STORE8    XXXX


O/p files:

File1:
Code:

STORE1    XXXX
STORE1    XXXX
STORE1    XXXX
STORE1    XXXX
STORE2    XXXX
STORE2    XXXX


File2:
Code:

STORE3    XXXX
STORE3    XXXX
STORE3    XXXX
STORE3    XXXX
STORE3    XXXX


File3:
Code:

STORE4    XXXX
STORE4    XXXX
STORE4    XXXX
STORE4    XXXX
STORE4    XXXX
STORE4    XXXX
STORE4    XXXX


File4:
Code:

STORE5    XXXX
STORE5    XXXX
STORE6    XXXX
STORE6    XXXX
STORE7    XXXX


File5:
Code:

STORE8    XXXX
STORE8    XXXX
STORE8    XXXX
STORE8    XXXX
STORE8    XXXX
STORE8    XXXX
STORE8    XXXX


Rules for getting the O/P are:

We need to check the store(s) for which number of records is less than/equal to 6 then those records should go in one file. if sum of records for stores( say two stores in number) is exceeding than 6 then first store's records will go in one file and the records of 2nd store will be considered for number of records with next store. Maximum number of o/p files can be 10. suppose 9 files are already created then the 10th file will contain all the rest of records.

Can anybody please help me in this? I hope the requirement is clear.

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

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Sep 08, 2010 3:37 am
Reply with quote

GaganGarg,
Are you Ok with creating empty files incase you have less number of records?

Is there a limit to max. number of records in a singlefile for given Store Number? For Example, if you have 1000 records for STORE8, would you have them all in your FILE5? If not, how would you like to split them?

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

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Wed Sep 08, 2010 9:06 am
Reply with quote

Hi sqlcode1,

Thanks for the reply.
Quote:

Are you Ok with creating empty files incase you have less number of records?


Yes, that will be absolutely fine. not a problem at all.

Quote:

Is there a limit to max. number of records in a singlefile for given Store Number? For Example, if you have 1000 records for STORE8, would you have them all in your FILE5? If not, how would you like to split them?


There is no limit on the number of records for a given store in a file. in the case you mentioned here, we can have all 1000 records for store8 in FILE5.

thanks
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 2
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top