全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3976 3
2013-05-04
下面的例子,将a5和a6按照x变量横向合并,得到a56数据集。 a56数据集的第2、3行为什么in_b变量仍然是1?谢谢。


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;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-5-4 11:12:44
The key exists in b too
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-5-4 11:23:17
each of the three x=1 in table a5   
   merged with x=1 in table a6.
   When the three merge happens, the inb does not change

     a5     a6
    x  y   x  y   _n_
    1-----1        1  
          / /   
        / /     
    1   /            2   
        /           
       /
    1               3
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-5-4 13:11:12
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 values(b and c) of y in table5 do not exist in table6, the flags do not change.

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群