由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - ask for help (urgent): A SAS question
相关主题
SAS how to change variables' namea SAS problem
April 22/ 2014 SAS BASE PASSAbout ID in sas
请教:三道SAS BASE题count unique values in file with 1 million rows
请问SPSS 或者 SAS中变量名的变换 AABB - BBAA请问如何把一个数据里所有的变量名后面都加个v?thanks.
请教SAS LABEL问题。how to create page x of y in SAS
[合集] 问个SAS的问题用SAS找单词
求教proc sql 问题sas and environmental variables
SAS问题求助!SAS中FORMAT问题求教
相关话题的讨论汇总
话题: rename话题: sas话题: variables话题: data
进入Statistics版参与讨论
1 (共1页)
e*******e
发帖数: 75
1
Hi,
I am wondering who knows how to remove all the underscore in the variable
name? I have a data set with more than 200 variables and most of them have
more than one underscores. Is there any way to automatically rename all the
variables (removing the underscores in all of the variables in the data set)
instead of rename them one by one?
Many thanks!
B****N
发帖数: 440
2
教你一个简单的笨办法。
1,用proc contents打出variable names;
2,拷贝到excel里,替换掉下划线;
3,然后再data step里rename.
用SAS本身也能做,但如果你只做这一次的话,这个更省时间。
k*******a
发帖数: 772
3
写了隔macro你试试看
%macro rename(lib=,data=);
proc sql;
select strip(name)||'='||compress(name,'_') into :rename separated by ' '
from sashelp.vcolumn
where upcase(libname)=upcase("&lib") and upcase(memname)=upcase("&data");
quit;
data new;
set &lib..&data;
rename &rename;
run;
%mend;
e*******e
发帖数: 75
4
thank you :)
1 (共1页)
进入Statistics版参与讨论
相关主题
SAS中FORMAT问题求教请教SAS LABEL问题。
SAS code求教[合集] 问个SAS的问题
SAS输出到Excel/pdf求教proc sql 问题
如何用SAS找出含有特定字符的observation?SAS问题求助!
SAS how to change variables' namea SAS problem
April 22/ 2014 SAS BASE PASSAbout ID in sas
请教:三道SAS BASE题count unique values in file with 1 million rows
请问SPSS 或者 SAS中变量名的变换 AABB - BBAA请问如何把一个数据里所有的变量名后面都加个v?thanks.
相关话题的讨论汇总
话题: rename话题: sas话题: variables话题: data