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

Split files into 4 equal parts


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

New User


Joined: 09 Sep 2008
Posts: 31
Location: India

PostPosted: Thu Jan 15, 2009 10:51 am
Reply with quote

Hi,

I have a requirement wherein, i need to split a file into 4 equal parts.

There are no predefined conditions or anything for splitting up.
There is no dynamic input on how much splits.

One file - 4 splits. Obviously if the record count is not divisible by 4, the 4th split will have a lesser no. of records compared to other 3.

Can someone give a heads-on how this can be acheived?
Back to top
View user's profile Send private message
janusman

New User


Joined: 09 Sep 2008
Posts: 31
Location: India

PostPosted: Thu Jan 15, 2009 10:54 am
Reply with quote

To clarify

if the i/p has 20 records,

output shud be

o/p1 - first 5 records
o/p2 - next 5 records
o/p3 - next 5
o/p4 - last 5 records

If the i/p has 23 records

o/p1 - first 6 records
o/p2 - next 6
o/p3 - next 6
o/p4 - remaining - in this case - 5 records
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: Thu Jan 15, 2009 11:12 am
Reply with quote

Hello,

This has been asked multiple times previously. From those topics, here is the response:
Quote:
See the "Split a file to n output files dynamically" Smart DFSORT Trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
janusman

New User


Joined: 09 Sep 2008
Posts: 31
Location: India

PostPosted: Thu Jan 15, 2009 11:30 am
Reply with quote

Hi,

My bad. thanx.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
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
Search our Forums:

Back to Top