Interesting footnote to this question. Did you know that you can specify _null_ as an output file to proc sort? Before today, I didn't!
However, in trying to test the idea that the nouniquekey and uniqueout options might be faster than doing a sort and then using first. and last. in a datastep, I was bothered that I (thought I) had to create a dummy output file. Not so!
proc sort data=have out=_null_ nouniquekey noequals UNIQUEOUT=want;
by id;
run;
On a 1.9 million record file, with 19 unique ids, the above only took 0.49 seconds.
The sort alone of the initial file (needed, of course in order to use first. and last. processing, took 0.68 seconds.
Not that I've ever needed a file of records that don't have duplicates, but nice to know which would be the most efficient process.
Art, CEO, AnalystFinder.com
... View more