good work and thanks for gogotiger!!作者: shiyiming 时间: 2012-8-9 10:19 标题: Re: 不同数据集变量重命名 to gogotiger and other_big_man,
在网上搜索了下,在一篇blog中发现的code,
[code:2mux6t9z]%macro renamevar(dslib,dsname,prefix,suffix,fromnum,tonum) ;
ods listing close;
ods trace on;
ods output variables=varlist ;
proc contents data=&dslib..&dsname;
run;
ods trace off;
ods listing;
proc sql;
select cats(variable,"=","&prefix._",variable,"_&suffix")
into :renamelist separated by " "
from varlist
where num between &fromnum and &tonum;
quit;