haizai110 发表于 2009-9-23 14:41
data work.A;
input NUM x y z;
total=sum(x y z);
IF total>280 THEN PUT NUM total;
CARDS;
1001 79 96 87
1002 89 96 98
1003 87 69 81
;
run;.
运行老是报错,不知道哪错了
lz, 偶猜测你是想将 total>280 的数据(包括 no. 和 total) 输出到 work.A 中,如果猜测没错的话,将程序稍作修改就可达到目的。示意如下:
data A;
input NUM x y z;
total=sum(x,y,z);/
*注意 x y z 之间的逗号*/
IF total>280 THEN
output;
CARDS;
1001 79 96 87
1002 89 96 98
1003 87 69 81
;
run;
data B;
set A;
drop x y z;
proc print data=B;
run;
下面是程序运行结果,希望是LZ所需要的。
The SAS System 17:22 Thursday, September 23, 2009 2
Obs NUM total
1 1002 283