这个程序看不懂,不知道sas data view是用来干嘛的?
哪位大牛能解释下view的作用是什么么?或者能给个reference不?
data view1 / view=view1;
set mydata;
by BYVAR;
if first.BYVAR then __n=0;
__n+1;
run;
data view2 / view=view2;
set mydata;
by BYVAR;
if first.BYVAR then __n=0;
if ^first.BYVAR;
__n+1;
run;
data lead;
merge view1
view2(keep=BYVAR var rename=(var=lead_var));
by BYVAR __n;
drop __n;
run;