x cd /pub/data/acs2015/Tools; %let pgm=edit_basetabs_varsets; filename pgm "&pgm..sas"; *---This setup used to edit the 6 variables<&tabset> data sets to make them conform. jgb, strting 9-14-16 ==============================This job probably NOT NECESSARy! Later job create_basetables_varlabsXX writes (over) the variables data sets!=== ---*; %let year=2015; %let period=1; *--can be 1, or 5---; %let yearm4=%eval(&year-4); %let yearm2=%eval(&year-2); %let yr=%substr(&year,3,2); %let cbsayr=15; title "&pgm.: Convert &year &period Geographic headers Data"; *options compress=yes; libname acs&year "/pub/data/acs&year"; *<====; %let geosetname=allgeos&period.yr; libname temptabs "/pub/data/acs&year/basetbls/temptabs"; ** access=readonly; libname basetbls "/pub/data/acs&year/basetbls"; %macro dotabset(tabset,sort=); *--for now we are not really using the sort parm. --; data basetbls.variables&tabset(label="Variable-level metadata for &tabset base table sets"); set temptabs.variables&tabset; *--Problem this cycle is with the Name variable. It uses the 3-digit suffix with extra 0s and we dont name our variables that way. We use c01001i7 NOT c01001i007 . So we need to fix that-; _lname=length(name); if lowcase(substr(name,_lname-3,1))='i' then substr(name,_lname-2)=left(put(TableCell,3.)); drop _lname; run; %mend dotabset; %dotabset(00_07); %dotabset(08); %dotabset(09_16); %dotabset(17_20); %dotabset(21_24); %dotabset(25_28);