x cd /pub/data/acs2012/Tools; %let pgm=fix_pctgqs; filename pgm "&pgm..sas"; *--We had a problem with the defn of pctGrpQuarters variable for this vintage. We need to redo these data sets to fix it--; *---We did renaming of data sets interactively after this ran. The old sets were renamed with sfx _badpctgq and then the _fixed sets were renamed to replace the originals. The data sets affected were usmcdcprofiles both years, usmcdcprofilesalt in 2013 and usmcdcprofiles3yr in 2012. Also the orignal (GR) data sets for both years, usmcdcprofiles_2013 and usmcdcprofiles_2012 (which we only use as a source and do not make publicly accessible.) ---*; libname acs2012 '/pub/data/acs2012'; libname acs2013 '/pub/data/acs2013'; %global setnames; options mprint; %macro dosets(libref); proc sql; create table dsets as select libname, memname from dictionary.tables where lowcase(libname)="&libref" and index(lowcase(memname),'usmcdcprofiles') and index(memname,'5YR')=0 and index(lowcase(memname),'fixed')=0; select memname into :setnames separated by ' ' from dsets ; quit; %put setnames= &setnames; %let setname=%scan(&setnames,1); %do i=1 %to 50 ; %let setname=%scan(&setnames,&i); %if &setname=%str() %then %goto aftloop; data &libref..&setname._fixed; set &libref..&setname; pctGrpQuarters=100*GrpQuarters/Totpop; run; %end; %aftloop: %mend dosets; %*dosets(acs2013) ; %dosets(acs2012);