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
 

 

Splitting a file based upon volume of data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Splitting a file based upon volume of data
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: 578
Location: USA

PostPosted: Wed Sep 08, 2010 3:37 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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