10-24-2013 10:20 AM
I have a table looks like this...
How to retain either one of the two rows like the first two?
10-24-2013 10:37 AM
So I have one table with a charater variable and a match-key variable
I made a copy of this table but renamed the character variable as Character_match
Then I matched these two tables together based on the match-key variable.
So three conditions would happen in the matching process...
1. Character was matched to Character_match with the exact same value (self-to-self)
2. Character was matched to Character_match with different values (self-to-other)
3. Character (Character_match) was matched to Character_match (Character) with different values (other-to-self)
Because Character_match is just a copy of Character, so condition 2 and 3 are permutations..
Now I want to retain the rows that have a unique combination of Character and Character_match (different values) regardless of the order.
The typical min(), max() method will not work here since they are character variables.
10-24-2013 10:53 AM
10-24-2013 11:47 AM
informat character character_match $20.;
input character character_match;
data same different;
if character eq character_match then output same;
x=ifc(character gt character_match,character,character_match);
y=ifc(character lt character_match,character,character_match);
proc sort data=different nodupkey out=oneeach dupout=dups;
by x y;