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

Splitting a file equally into 7 different files


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

New User


Joined: 11 Feb 2008
Posts: 14
Location: Chennai

PostPosted: Tue Feb 12, 2008 9:24 am
Reply with quote

Hi...

Please find the requirement below:

Split a input file (record count in unknown) into say 7 output files in such a way that each of the output files contain same number of records.

for eample:
if rec count in input= 734
for splitting -> 734/7=101 27

as per the req: each out put file must contain: 101 records.
The records which is left out must be ignored.

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

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Feb 12, 2008 8:38 pm
Reply with quote

Have you tried to alter the similar solution provided in the post titled Split a file in 5 files containing equal number of records?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Feb 12, 2008 10:58 pm
Reply with quote

prabhu,

You can use the technique shown in 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
prabhu118
Currently Banned

New User


Joined: 11 Feb 2008
Posts: 14
Location: Chennai

PostPosted: Wed Feb 13, 2008 12:52 pm
Reply with quote

Hey thanks for all ur reponses..

i got it myself....

See the example below...

Total records in input file...= 708
if we split this by seven= each of the output file will have 101 records except the 7th which will have 102.

Now let me tell you all very clearly the exact req:
req is (from above example) to get every 101th record. Kind of sampling...

I used the sample and STARTREC option available with ICETOOL.

Please see the logic followed:
1. getting total count of rec in input file using COUNT option and writing it to say a temporary file '&&T1'
2. Dividing the count obtained in &&T1 by 7 and populating the result in other temporary file &&L1.
3. Creating a card where will get the below mentioned:
STARTREC=(VALUE IN &&L1 +1),SAMPLE=(Value in &&l1).

I know its too confusing ...
try this u will get it....

bye
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top