全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
38915 13
2012-09-20
求高手!
我想问一下,sas中的rename有时候怎么不好用?
proc import out=temp datafile='E:\新数据\干燥.xls' dbms=excel replace;
getnames=yes;sheet='sheet5$';
run;
data temp1;set temp;keep=ttwd1  sdz1;rename ttwd1=ttwd  sdz1=sdz;run;
这时候输出的数据集
         3.png    


为什么显示的变量还是ttwd1和sdz1??此时变量的属性中Name为ttwd,Label为ttwd1.求解!十分感谢!
附件列表
2.png

原图尺寸 18.93 KB

2.png

1.PNG

原图尺寸 31.79 KB

1.PNG

1.JPG

原图尺寸 55.55 KB

1.JPG

二维码

扫码加我 拉你入群

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

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

全部回复
2012-9-20 22:00:04
因为显示的是label,在查看里勾选列名就显示列名。
二维码

扫码加我 拉你入群

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

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

2012-9-20 22:04:41
remove the "=" in keep=ttwd1  sdz1; It's a error.

If you want to remove the labels in data set, try this way:

* Remove all the labels in data set;
proc datasets lib=work memtype=data;
  modify your_data_set;
  attrib _all_ label=' ';
run;

Sorry, cannot type Chinese on my computer
二维码

扫码加我 拉你入群

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

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

2012-9-21 10:00:08
wwd1015 发表于 2012-9-20 22:04
remove the "=" in keep=ttwd1  sdz1; It's a error.

If you want to remove the labels in data set,  ...
Thanks very much.But I have to ask you another question.
The following codes run successfully,but the 'attrid' is in red colour,why?Are they right?The log does't show any error.
proc datasets lib=work memtype=data;
modify temp1 ;
attrib ttwd label='ttwd ' sdz label='sdz';
run;
二维码

扫码加我 拉你入群

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

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

2012-9-21 10:02:10
usm007 发表于 2012-9-20 22:00
因为显示的是label,在查看里勾选列名就显示列名。
十分感谢。不过是不是我太笨了?我怎么没在sas中找到查看选项那?求解!
二维码

扫码加我 拉你入群

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

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

2012-9-21 22:30:43
fyfzhdsfdx 发表于 2012-9-21 10:00
Thanks very much.But I have to ask you another question.
The following codes run successfully,but ...
Well, sometimes the SAS Enhanced Editor syntax coloring feature doesn't work correctly, so don't worry too much about the 'red' color. The attrid statement here is definitely right and you can check the link below
http://support.sas.com/documenta ... .htm#a003185601.htm

Thanks
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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