%macro rnm(data=,out=); proc contents data=&data out=t1(keep=varnum name) noprint; run; proc sql noprint; select name into :classname separated by' ' from t1 order by varnum; quit; %put &classname; data &out; set &data; %let i=1; %do %until (%scan(&classname.,&i.," ")=); %let yn=%sysfunc(compress(%scan("&classname",&i," "))); rename &yn=C&i; %let i=%eval(&i.+1); %end; proc datasets nolist; delete t1; run; %mend; /*调用*/ %rnm(data=test1,out=test2); /*去除所有label*/ proc datasets lib=output noprint; attrib _all_ label=''; run;