需要批量重命名为 b1x,b2x ...b100x
测试数据:
- data a1;
- a1x=1;
- a2x=2;
- a3x=3;
- a4x=5;
- a5x=123;
- a6x=1;
- a36x=1;
- a110x=1;
- run;
我的做法:
- proc sql noprint;
- select strip(name)||'=b'||substr(name,2)
- into :rename_list separated by ' '
- from dictionary.columns
- where libname="WORK" and memname="A1" and name like 'a%';
- quit;
- proc datasets library=work nolist;
- modify a1;
- rename &rename_list;
- quit;
想请教一下各位大师有没有不用PROC SQL的做法? 有的话麻烦贴一下…让小弟可以学习一下 多谢