data test;
do i=1 to 1000;
a=int(rannor(123)*10);
output;
end;
run;
proc sort data=test;
by a;
run;
data want;
set test(firstobs=11 obs=990);
run;
排序,然后firstobs=排出前百分之一后的第一个观测 obs=排出后百分之一后的最后一个观测
data test;
do N=1 to 1234;
a=rannor(123)*1000;
b=ranuni(111)*1000;
output;
end;
run;
proc sql noprint;
select count(*) into : Num_obs
from test;
quit;
%put number of observation in data set test is: &num_obs;
proc sort data=test; /* do this if you want top and bottom removed */
by a;
run;
data test2;
set test;
if _N_/&num_obs > 0.01 and _N_/&num_obs < 0.99 then output;
* if _N_/&num_obs >= 0.01 and _N_/&num_obs <= 0.99 then output;
run;