SAS中文论坛

标题: 请教,对于大量数据的抽取 [打印本页]

作者: shiyiming    时间: 2009-8-5 20:01
标题: 请教,对于大量数据的抽取
请教各位,如果一个表每天都会新增几万条数据,那么在对这个表进行抽取的时候有没有什么优化方法,或者是能提高些许效率的办法,谢谢!
作者: shiyiming    时间: 2009-8-7 08:17
标题: Re: 请教,对于大量数据的抽取
1. assign a sequencial number to the record in your data set (e.g. 100 records);
data myData;
set originalData;
rec=_N_;
run;
2. create a data set which contains the randomly selected records (e.g. 20);
data pickup_rec(drop=i);
do i=1 to 100;
rec=int(100*ranuni(12345)); /*you have to make decision of selection with replacement or without replacement*/
output;
end;
run;
3. merging
proc sql;
create table Result as
select a.* from myData as a, pickup_rec as b;
where a.rec=b.rec
order by a.rec;
quit;




欢迎光临 SAS中文论坛 (https://mysas.net/forum/) Powered by Discuz! X3.2