x cd /pub/data/mable14/Tools; %let pgm=test_bgpopmatch; filename pgm "&pgm..sas"; *---We look at all the BGs in the US with their 2010 pops from mable14 and compare this with all the BGs available to us in the latest ACS data files (vintage 2013 today but 2014 very shortly). The CSV input file with mabel data was generated using the web app. ---*; %let acsyear=2013; %let acsyr=%substr(&acsyear,3,2); title "&pgm.: Checking for Mismatches Between the ACS (2013 vintage) BGs and Those on mable14 (2010 census)"; libname acs "/pub/data/acs&acsyear" access=readonly; libname mable14 '/pub/data/mable14'; libname user "/SAS_temp/userb"; filename csvin "/pub/data/mable14/&pgm._input.csv"; /*<=========================Comment out===================================== data mable; infile csvin dsd firstobs=3; length County $5 tract $7 bg $1 State $2 puma12 $5 pop10 4; input county--pop10; run; ===========================End commented out================================ */ data mable14.bgacspops(label="All US block grps with ACS 5yr Pop Ests Vintage &acsyr") nomatch; merge acs.usbgs5yr(keep=state county tract bg totpop totpopsf1 totpop00 in=_inacs) mable(in=_inmable); by county tract bg; InACS=_inacs; InMABLE=_inmable; if inmable and inacs then output mable14.bgacspops; else output nomatch; run; proc print data=nomatch label; by state; id county tract bg; sum inacs inmable totpopsf1 pop10 TotPop; title2 "Nomatch"; run; /*<=========================Comment out===================================== proc print data=mable14.bgacspops (obs=50); title2 "mable14.bgacspops"; by state; id county tract; run; ===========================End commented out================================ */ %include sascode (notify);