/*一对一合并,不需要by语句*/
data a;
merge resdat.class resdat.stk000001;
run;
(朱世武,126)
/*匹配合并必须有by语句*/
data a;
merge resdat.stk000001 (keep=date clpr rename=(clpr=clpr000001))
resdat.stk000002 (keep=date clpr rename=(clpr=clpr000002));
by date;
run;
(朱世武,126)
/*使用数据集选项(in=)*/
data a5;
input x y$ @@;
cards;
1 a 1 b 1 c 2 x 3 y
;
run;
data a6;
input x y$ @@;
cards;
1 aa 2 xx 4 yy
;
run;
data a56;
merge a5(in=ina) a6(in=inb);
by x;
in_a=ina;
in_b=inb;
run;
/*The IN=data set option is a flag to the variable of the BY group instead of any other variables.*/
/*Because the variable x(not y) is in the BY group,so although the va