c*****p 发帖数: 51 | 1 When I combine below first three data steps into one single data step at the
bottom, it generates different results. Can anybody figure out why? Thank
you very much.
data A;
merge X(in=a) Y(in=b);
by key_id;
if a=1;
run;
data A;
set A;
if year<=2006 then id=new_id;
run;
data A;
set A;
drop new_id;
run;
data A(drop = new_id);
merge X(in=a) Y(in=b);
by key_id;
if a=1;
if year<=2006 then id=new_id;
run; |
g****8 发帖数: 2828 | 2 你把 drop放最后试试。
the
【在 c*****p 的大作中提到】 : When I combine below first three data steps into one single data step at the : bottom, it generates different results. Can anybody figure out why? Thank : you very much. : data A; : merge X(in=a) Y(in=b); : by key_id; : if a=1; : run; : data A; : set A;
|
o****o 发帖数: 8077 | 3 这两个判断语句换个次序
if a=1;
if year<=2006 then id=new_id;
the
【在 c*****p 的大作中提到】 : When I combine below first three data steps into one single data step at the : bottom, it generates different results. Can anybody figure out why? Thank : you very much. : data A; : merge X(in=a) Y(in=b); : by key_id; : if a=1; : run; : data A; : set A;
|