View previous topic :: View next topic
|
Author |
Message |
Lord.of.Wind
New User
Joined: 17 Nov 2005 Posts: 60
|
|
|
|
Masters,
I want to code a SORT to filter out some records having duplicate data.
For example:
Code: |
010 123456789 123456789tom20maleboston
010 123456788 123456777tim25malenewyork
|
In the first record, there are two duplicate numbers 123456789, I want to remove any record in such a case.
In the second, 123456788 not = 123456777, so it should be kept.
How to code it?
Thanks! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you look back about 12 hours in this part of the forum.
Your exact question was asked and answered. . . |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Use below sortcard...
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(5,9,ZD,EQ,15,9,ZD)
/*
|
|
|
Back to top |
|
|
Lord.of.Wind
New User
Joined: 17 Nov 2005 Posts: 60
|
|
|
|
Sorry I forgot one point.
How to filter out the duplicate-data record from the second, and the third, the fourth...?
Code: |
010 123456789 123456789tom20maleboston
010 123456789 123456789May20femlboston
010 123456789 123456789Lee20maleboston
010 123456788 123456777tim25malenewyork
|
The second, the third should be filtered out. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
did You care to try to understand, and maybe test the snippet given by Sambhaji ? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Load.of.Wind
Can you kindly take the time to explain EXACTLY what it is that you want to do. From your posts so far I am not sure if you are still talking comparing record fields internally, or if you want whole records which are duplicates of others to be filtered out as well.
Show the input, with RECFM & LRECL
Show the desired output, again with RECFM & LRECL
Explain the rules for getting from input to output. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
expat
.. a bit harsh, maybe, on "LoRd.of.Wind" ?
Garry.[/quote] |
|
Back to top |
|
|
|