x cd /pub/data/acs/Tools; %let pgm=fix_b25_27_1yrbasetabs; filename pgm "&pgm..sas"; *******************We ran this twice, once specifying the _moes data set and then the estimates data set. We then renamed the input set with the 3 ids (to "_3ids") and then the _fixed to no-suffix set. ***********; *---we had a problem with these 2 data sets and Glenn regenerated them to get variable names right. But the geo and other id vars were not right (just had the basic 3: geoid, logrecno and areaname) and sort was not by geoid as with others. So we use this job as a 1-time fix (hopefully)------; libname btabs '/pub/data/acs2011/basetbls'; %let moes=%str(_moes); proc sort data=btabs.ustabs25_27 out=ustabs25_27; by geoid; run; data btabs.ustabs25_27_fixed; *---We keep only the 10 id variables from the ustabs00_07 set and combine them with the tabs data--; merge btabs.ustabs00_07(in=in1 keep=stab--areaname) ustabs25_27 (in=in2 rename=(logrecno=logrecnock)); by geoid; if not (in1 and in2) or (logrecno ne logrecnock) then do; put "***Logic or data problem with &moes :" _all_; abort abend; end; drop logrecnock; run;