I wonder if there is a way to unduplicate records WITHOUT sorting?Sometimes, I want to keep original order and just want to remove duplicated records.
I
This is the fastest way I can think of. It requires no sorting.
data output_data_name; set input_data_name ( sortedby = person_id stay keep = person_id stay ... more variables ...); by person_id stay; if first.stay > 0 then output; run;