04-26-2016 10:00 AM
I want to select the top 10 obs with largest "amount" variable. Using the code belwo, sorting is done, but I still got the whole set, not the first 10 obs. What could be the problem that "obs=10" did not work?
proc sort data=have out=top_10 (obs=10); by descending amount; run;
04-26-2016 11:09 AM
From the online documentation onthe OBS=Data set option:
|Restriction:||Use with input data sets only|
Sort you data and then use
set top_10 (obs=10);