I want to dedupe the duplicate codes based on their Score, the highest score stays followed by sorting high to low of score. But, if the score is the same & reason codes are different, I want to maintain the order of reason codes. The dedupe only happens across one id, ID - 1 would *not* look for duplicates in ID - 2 Example - HAVE - data have; input id name $ score code $; datalines; 1 John 23 A05 1 John 26 A02 1 John 26 A03 1 John 26 A01 2 Mark 21 A05 2 Mark 22 A05 2 Mark 23 A07 ; run; ID NAME SCORE CODE 1 John 23 A05 1 John 26 A02 1 John 26 A03 1 John 26 A01 2 Mark 21 A05 2 Mark 22 A05 2 Mark 23 A07 WANT - ID NAME SCORE CODE 1 John 26 A02 [ Same Order as HAVE ] 1 John 26 A03 1 John 26 A01 1 John 23 A05 2 Mark 23 A07 2 Mark 22 A05
... View more