I am trying to get rid of records with duplicate key (the by value in proc sort). I tried different syntax and could never get it to work. The field ID1 is the key. I want to have unique ID1 in the outfile.
I have used:
PROC SORT; BY ID1; NODUP;
PROC SORT; BY ID1 NODUP;
none of these work. Does anyone have any suggestion?
Also, remember, for NODUP to work, the duplicate observations must be adjacent, which implicitly calls for a reasonably granular BY variable list when using the function. And, PROC SORT yields no mercy if you forget and code a BY variable list that will not achieve the required condition in order for the sort package to do its job removing duplicates.