Split the file exactly into two.



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Split the file exactly into two.

Postby rsangeeth » Fri Aug 03, 2012 6:53 pm

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.
rsangeeth
 
Posts: 2
Joined: Mon Oct 26, 2009 4:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Split the file exactly into two.

 

Re: Split the file exactly into two.

Postby dick scherrer » Fri Aug 03, 2012 7:35 pm

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
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Split the file exactly into two.

Postby rsangeeth » Fri Aug 03, 2012 8:12 pm

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.
rsangeeth
 
Posts: 2
Joined: Mon Oct 26, 2009 4:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Split the file exactly into two.

Postby Akatsukami » Fri Aug 03, 2012 8:20 pm

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".
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Split the file exactly into two.

Postby dick scherrer » Fri Aug 03, 2012 9:54 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post