You granted me the "correct answer" before I deliver a correct one. The previous one only works if all of your variables are in the format of /bic/, you would need more fire power than scan() function if you want to ignore those not in literals. data have; input '/bic/var1'n '/bic/var2'n var3; cards; 1 2 3 ; proc sql; select cats("'",name,"'N","=", prxchange('s/\/bic\///io',-1,name)) into :ren separated by ' ' from dictionary.columns where LIBNAME='WORK' AND MEMNAME='HAVE'; QUIT; DATA WANT; SET HAVE; RENAME &ren; RUN; Regards, Haikuo
... View more