merge合并2个或2个以上的数据集。
libname saslib "k:\sas";
data saslib.goodsprice;
input id name$ price 6.2;
datalines;
1 鼠标 35.6
2 键盘 28.95
3 鼠标垫 8.2
4 耳麦 29.7
;
data saslib.goodsquantity;
input id quantity;
datalines;
1 150
2 98
4 162
3 45
;
proc sort data=saslib.goodsprice;
by id;
proc sort data=saslib.goodsquantity;
by id;
data saslib.mygoods;
merge saslib.goodspricesaslib.goodsquantity;
by id;
run;
proc print data= saslib.mygoods;
run;
本博客所有内容是原创,如果转载请注明来源
http://blog.csdn.net/myhaspl/
时间: 2024-10-13 20:13:30