全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
4118 14
2014-03-23
例如现在又两个数据集
数据集 a
id name
1 qqq
2 www
3 rrr
2 vvv
1 jjj
数据集 b
id   name
1    @#
2    &……
3    *&


数据集B中的name是乱码,我想用数据集a中的name更新数据集b的name 且id相互匹配。

请教如何实现

二维码

扫码加我 拉你入群

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

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

全部回复
2014-3-23 12:06:11
data b;
merge b a;
by id;
方法很多,用update代替merge也可以,但是merge比较简单
二维码

扫码加我 拉你入群

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

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

2014-3-23 12:27:25
intheangel 发表于 2014-3-23 12:06
data b;
merge b a;
by id;
WARNING: Multiple lengths were specified for the variable name by input data set(s). This may cause truncation of data.
WARNING: The MASTER data set contains more than one observation for a BY group.
。。。。。
ERROR: BY variables are not properly sorted on data set MYDATA.CN00
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 6833 observations read from the data set MYDATA.IE_P_JAP.
NOTE: There were 59622 observations read from the data set MYDATA.CN00.
WARNING: The data set MYDATA.IE_P_JAP may be incomplete.  When this step was stopped there were 7472 observations and 120 variables.
WARNING: Data set MYDATA.IE_P_JAP was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.25 seconds
      cpu time            0.21 seconds
失败。。难道是因为数据集格式不一样不能merge吗,求教
二维码

扫码加我 拉你入群

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

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

2014-3-23 12:39:26
may3000 发表于 2014-3-23 12:27
WARNING: Multiple lengths were specified for the variable name by input data set(s). This may caus ...
你b中的name是numeric还是character?
二维码

扫码加我 拉你入群

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

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

2014-3-23 13:07:47
intheangel 发表于 2014-3-23 12:39
你b中的name是numeric还是character?
b中的是$32.
a中的是$200.
二维码

扫码加我 拉你入群

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

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

2014-3-23 13:10:15
intheangel 发表于 2014-3-23 12:39
你b中的name是numeric还是character?
而且我直线更新name,这样会不会把其他的变量也改变了?
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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