Hi, I have a data set that has 200 columns, named VAR1, VAR2, ..., VAR200, say. I need to rename all these in a data step, something like this. %let realname=A B C D E; /*200 different names*/ ***Create a list of 200 fake vars VAR1, VAR2, ...., VAR200; %macro create_200_vars; %global fakevars; %do i=1 %to 200 %by 1; %let fakevars=&fakevars. VAR&i.; %end; %put &fakevars; %mend create_200_vars; data renamed; set unnamed; /*Dataset with unnamed vars VAR1, VAR2, ..., VAR200*/ do i=1 to 200 by 1; rename VAR&i.=scan(&fakevars., &i.); ***WRONG HERE, but don't know how to fix it in this datastep; end; run; Could you please help? Thanks
... View more