rockfido 发表于 2010-4-27 03:04 
如果我有一个DATA SET A,不知道里面有多少变量,也不知道变量的名字。
请问有没有办法讲变量的名称改为:COL1,COL2,COL3,...COLN?
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;