This is a common request. The strategy is to (1) get the metadata (in this case all the variable names, each followed by and equal sign and a corresponding new variable name) into a macro variable, Then include this macrovar in a rename statement in a PROC DATASETS, as in:
data have;
array v {500} var1-var500;
do _n_=1 to dim(v); v{_n_}=_n_; end;
output;
stop;
run;
proc sql noprint;
select
cats(name,'=',name,'_chg')
into :rename_list separated by ' '
from dictionary.columns where libname='WORK' and memname='HAVE';
quit;
proc datasets library=work nolist;
modify have;
rename &rename_list ;
run;
quit;
There are a number of metadata resource in various members of the DICTIONARY container, which is accessible only via a proc sql. This particular members here is COLUMNS.
regards,
Mark