我根据c_id, c_age 排序后,单独用first去判断c_age这个变量,在创建test2数据集时,出了问题。
if first.c_age then new=0;
by c_age;
求教我如何绕开这个问题呢?
data test;
input c_id c_age c_aum;
cards;
1 2 3
1 3 4
1 1 4
2 2 2
2 4 6
2 5 7
3 2 1
3 4 1
;
run;
proc sort data=test out=test1;
by c_id c_age;
run;
data test2;
set test1;
new=1;
if first.c_age then new=0; /*有问题*/
by c_age; /*有问题*/
run;