Hi! data_null has a good solution, but you can do it with less code. You can use the dictionary libname or proc contents to get the list of variables from the dataset you want to change. /*option 1*/ proc sql noprint; select distinct compbl(name||" = "||compress(name||"_v1")) into :re separated by ' ' from dictionary.columns where libname = 'WORK' and memname = 'MYDATA'; quit; /*option 2*/ proc contents data = mydata out = var (keep = name) noprint; run; proc sql noprint; select distinct compbl(name||" = "||compress(name||"_v1")) into :re separated by ' ' from var; quit; /*last step after option 1 or 2*/ proc datasets lib = work nolist; modify mydata; rename &re.; run;quit;
... View more