标题: 如何合并两列的内容成一列在sas 中 [打印本页] 作者: shiyiming 时间: 2009-3-12 13:09 标题: 如何合并两列的内容成一列在sas 中 如题,谢谢作者: shiyiming 时间: 2009-3-12 15:06 标题: Re: 如何合并两列的内容成一列在sas 中 ?
如果两列内容是在不同的sas数据集中,你可以用datasets语句中的append base=数据集1 data=数据集2,就可以把数据集2的变量追加到数据集1的后面(注意两个变量名必须相同)。作者: shiyiming 时间: 2009-3-13 11:52 标题: Re: 如何合并两列的内容成一列在sas 中 Thank you for your reply. It is really helpful.
if they are in the same data set, what can I do ?作者: shiyiming 时间: 2009-3-15 20:50 标题: Re: 如何合并两列的内容成一列在sas 中 同问~~~作者: shiyiming 时间: 2009-3-16 17:08 标题: Re: 如何合并两列的内容成一列在sas 中 hi, is it ok?
data ex1;
input a b ;
cards;
12 3
3 4
;
data ex;
set ex1(keep=a) ex1(keep=b rename=(b=a));
run;作者: shiyiming 时间: 2009-3-23 14:33 标题: Re: 如何合并两列的内容成一列在sas 中 不知我理解是否正确,我觉得你可能是想说如何处理文字,也就是将两列文字合并成为一列?
[code:27hdmcx7]
data a;
set a;
Z=x||Y;
run;
[/code:27hdmcx7]
或者使用cat, catt, catx函数。。对应于R的cbind, Gauss 的||;
如果是列,那就用append base= data=; 对应于R的rbind, Gauss 的//;