Page 1 of 1

Split the file exactly into two.

PostPosted: Fri Aug 03, 2012 6:53 pm
by rsangeeth
Hello All,

I have a requirement wher i need to split PS VB file into 2 halves exactly. For eg the input file IFILE contains 10,000 records then i need the first 5000 records in OFILE1 and the second file into OFILE2, when i tried using the split comand it even number of records in one file and the odd numbers into other file. I have checked the "dfsort tricks" manual.

Can anyone please help here if there is a way this can be done via DFSORT/ICETOOL.

Thanks a lot in advance.

Regards,
Sangeeth.

Re: Split the file exactly into two.

PostPosted: Fri Aug 03, 2012 7:35 pm
by dick scherrer
Hello and welcome to the forum,

You need to explain why the even/odd split will not work for your requirement.

Suggest you look at '5 Ways To Split a Dataset' in the DFSort tricks.pdf

Re: Split the file exactly into two.

PostPosted: Fri Aug 03, 2012 8:12 pm
by rsangeeth
Hello,

Thanks for your quick reply. I checked this particular topic in the document, but i was not able to make use it for this particular requirement. Actually the file can contain 2 records for one account and if this is going to split into 2 different files then it cannot be processed in the next jobs in the chain. The file is sorted based on the account number and this cannot be split into 2 different files odd/even. Hope i have explained it clear.

Thanks,
Sangeeth.

Re: Split the file exactly into two.

PostPosted: Fri Aug 03, 2012 8:20 pm
by Akatsukami
rsangeeth wrote:Hello,

Thanks for your quick reply. I checked this particular topic in the document, but i was not able to make use it for this particular requirement. Actually the file can contain 2 records for one account and if this is going to split into 2 different files then it cannot be processed in the next jobs in the chain. The file is sorted based on the account number and this cannot be split into 2 different files odd/even. Hope i have explained it clear.

So in fact the data set cannot be split exactly in two. Perhaps you should restate your "requirement".

Re: Split the file exactly into two.

PostPosted: Fri Aug 03, 2012 9:54 pm
by dick scherrer
Hello,

So in fact the data set cannot be split exactly in two. Perhaps you should restate your "requirement".
And any/all rules for processing.

Do understand that the biggest part of getting help from a forum is clearly/com;pletely describing what you want to do.

The best way to explain something like this is to post (in paragraph form) your complete requirement - including some sample input data and the exact output you want from that input data. You do not need high volume. You do not need full-width records. Just enough to demonstrate the possible input and the needed output.

When posting data, you should use the Code tag to preserve alignment and improve readability. There is a Preview function so you can see your post as it will appear to the forum rather than how it appears in the Reply editor.