View previous topic :: View next topic
|
Author |
Message |
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Hi All,
I was referring post www.ibmmainframes.com/post-553.html to see when I do not say an 'EQAUALS' option, will I get a last dup by using a SUM FIELDS=NONE.
The information I have got is it can be either last or first dup if EQUALS is not specificied. Is there anyway I can ensure LAST dup is taken all the time? If not, any reason behind this?
Thanks,
Prajesh V Parambath |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Hi Gcicchet,
I cannot use a SYNCTOOL or ICETOOL here. Is there any solution using SUM FIELDS=NONE itself to get last dup?
Thanks,
Prajesh V P |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
I cannot use a SYNCTOOL or ICETOOL here |
Is there any valid reason for this statement. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
you can add a sequence number, then sort the records with the sequence in descending order, now you will have a file with the last duplicate first, now you can use SUM FIELDS=NONE.
Don't forget to use the equals option.
Gerry |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
deleted by poster - duplicate response to previous post. |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Expat,
We do have a restriction on SYNCTOOL as they say it s less efficient and less maintainable. I am not 100% sure if this is true, but still I have to be using simple sort.
Thanks,
Prajesh |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Oh well, there is always some fool that makes these restrictions on those trying to get the work done.
They probably do not realise that ICETOOL is actually a part of DFSORT, and I assume the same for SYNCTOOL and SYNCSORT. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
The information I have got is it can be either last or first dup if EQUALS is not specificied. Is there anyway I can ensure LAST dup is taken all the time? |
The information you got is wrong. With EQUALS, the first dup is kept. Without EQUALS, any record from the set of duplicates can be kept. There's no guarantee it will be the first or last record. The appropriate way to get the LAST duplicate is to use the ICETOOL SELECT operator with LASTDUP or LAST depending on what you want for output.
DFSORT's ICETOOL is just as efficient as DFSORT. DFSORT's ICETOOL is just as maintainable as DFSORT since complete documentation for both DFSORT and DFSORT's ICETOOL are available online. DFSORT's ICETOOL has been shipped with DFSORT since 1991!
As far as I know, there is no documentation for Syncsort's SYNCTOOL so maybe that's why somebody said it's "less maintainable" then SYNCSORT. But I'm just guessing. |
|
Back to top |
|
|
|