data b;
set a;
by x;
n+1;
if n<=10 and last.x then y=1;
run;
问题: 数据集A中的X是分类的样本情况(样本是变化的) ,现想提出样本n<=10,分类又必须是完整的数据。
也就是按照样本n<=10,分类是完整的话,就只能提出x的分类是 X <=4 的9个样本。
求助:如何得到。
谢谢!!作者: shiyiming 时间: 2009-12-27 23:39 标题: Re: 求助:数据的提出? [code:33ibezgd]data b;
do until(last.x);
set a;
by x;
n = sum(n, 1);
if last.x then s+n;
end;
do until(last.x);
set a;
by x;
if s <= 10 then output;
end;
run;[/code:33ibezgd]作者: shiyiming 时间: 2009-12-27 23:49 标题: Re: 求助:数据的提出? 就是我要的,非常感谢!!