|
On Mar 31, 1:26 pm, bruce.gil...@FRB.GOV ("Gilsen, Bruce F.") wrote:
> SAS
> Institute recommended PROC SORT+DATA step, not PROC SQL.
I am guessing it was a SORT DESCENDING, DATA, SORT ASCENDING.
An efficient technique would perform a SORT ASCENDING followed by a
double DOW DATA to obtain the top N.
proc sort data=have;
by year assets;
run;
data top5have;
do _n_ = 1 by 1 until (last.year);
set have;
by year assets;
end;
do _i_ = 1 to _n_;
set have;
if _i_ > _n_-5 then OUTPUT;
end;
run;
--
Richard A. DeVenezia
http://www.devenezia.com
p.s. The reflexive SQL join only works correctly when there are no
duplicates in the FROM tables.
p.p.s Oracle has some fantastic summarization features for within
partition (by group) processing.
|