楼主: fyfzhdsfdx
37742 13

[原创博文] sas中的rename [推广有奖]

  • 0关注
  • 0粉丝

硕士生

0%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
966 点
帖子
97
精华
0
在线时间
89 小时
注册时间
2012-8-22
最后登录
2016-9-24

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
求高手!
我想问一下,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.求解!十分感谢!
二维码

扫码加我 拉你入群

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

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

关键词:rename name ENA replace import replace import excel

2.png (18.93 KB)

2.png

1.PNG (31.79 KB)

1.PNG

1.JPG (55.55 KB)

1.JPG

沙发
usm007 发表于 2012-9-20 22:00:04 |只看作者 |坛友微信交流群
因为显示的是label,在查看里勾选列名就显示列名。

使用道具

藤椅
wwd1015 发表于 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

使用道具

板凳
fyfzhdsfdx 发表于 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;

使用道具

报纸
fyfzhdsfdx 发表于 2012-9-21 10:02:10 |只看作者 |坛友微信交流群
usm007 发表于 2012-9-20 22:00
因为显示的是label,在查看里勾选列名就显示列名。
十分感谢。不过是不是我太笨了?我怎么没在sas中找到查看选项那?求解!

使用道具

地板
wwd1015 发表于 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

使用道具

7
fyfzhdsfdx 发表于 2012-9-24 20:55:20 |只看作者 |坛友微信交流群
wwd1015 发表于 2012-9-21 22:30
Well, sometimes the SAS Enhanced Editor syntax coloring feature doesn't work correctly, so don't w ...
Thank you very much.

使用道具

8
kittyforever 发表于 2013-1-17 16:45:01 |只看作者 |坛友微信交流群
rename语句无论放在code的哪里, 总是最后才在pdv中起作用的

使用道具

9
肝贝 发表于 2014-2-26 12:38:22 |只看作者 |坛友微信交流群
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,  ...
您好,我想问您一个问题,sas里的逻辑库还能改名字吗?
I'll never let go.

使用道具

10
肝贝 发表于 2014-2-26 12:53:21 |只看作者 |坛友微信交流群
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,  ...
就是将原逻辑库的名字换一个,路径不改变,只是改名字,比如一个逻辑库叫aa,我现在想把它改为a,应该是怎么样一个程序呢,拜托了,谢谢~~
I'll never let go.

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-27 10:27