如果我有一个DATA SET A,不知道里面有多少变量,也不知道变量的名字。
请问有没有办法讲变量的名称改为:COL1,COL2,COL3,...COLN?
楼主: rockfido
|
7577
8
[原创博文] 如何将SAS DATA中的变量名改名(不知道原变量名的前提下) |
博士生 32%
-
|
回帖推荐Use sas utility procedure is the right way.
data t1;
a1=0;a2=0;ccd3=0;
run;
data _null_;
if 0 then set t1;
array _allvar_(*) _all_;
call execute('proc datasets; modify t1;rename ') ;
do i=1 to dim(_allvar_);
rename=catt(vname(_allvar_(i)),'=col',i);
call execute(rename) ;
end;
call execute(';run;quit;') ;
stop;
run;
本帖被以下文库推荐
| ||
| ||
| ||
京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明 免责及隐私声明