SAS中文论坛
标题:
合并和转置问题
[打印本页]
作者:
shiyiming
时间:
2003-11-4 17:50
标题:
合并和转置问题
对于两个数据集,结构如下:
DATA1
country sum
US 1000
CHINA 500
GERMAN 800
DATA2
country pctsum
US 0.25
CHINA 0.35
GERMAN 0.40
将这两个数据集根据SUM和pctsum进行转置,并且进行MERGE合并,如何避免重复的变量呢,
不要用RENAME直接改名.
作者:
shiyiming
时间:
2003-11-4 23:43
proc transpose data=data1 out=data11 prefix=a;
run;
proc print;run;
proc transpose data=data2 out=data22 prefix=b;
run;
proc print;run;
data data3;
merge data11 data22;
run;
proc print;run;
欢迎光临 SAS中文论坛 (http://mysas.net/forum/)
Powered by Discuz! X3.2