/* Update the dhc2020x block groups datasets to correct 2010 populations. */ %include '/pub/sas/autoexec.sas'; options spool nosource nosource2 nomprint nomlogic nosymbolgen nonotes; libname dhc '/pub/data/dhc2020x' compress=binary; %macro doit(state,stab); data state_updates; set dhc.bg_pops_2010_for_updating; where state = "&state"; run; proc sort; by esriid; run; PROC SQL; update dhc.&stab.bgs150 t1 set TotPop10 = (select totpop10 from state_updates t2 where t1.esriid = esriid) where esriid in (select esriid from state_updates); QUIT; PROC SQL; update dhc.&stab.bgs150 t1 set PopChange = TotPop - TotPop10, PctPopChange = ( (TotPop - TotPop10) * 100 ) / TotPop where 1=1; QUIT; * reindex ; data dhc.&stab.bgs150 (label="Block-group level (150) summaries for &statenm" index=(county)); set dhc.&stab.bgs150; run; %mend doit; /* begin comment ==================================== %dostates(01 02 04 05 06 08 09 10 11 12 13 15 16 17); %dostates(18 19 20 21 22 23 24 25 26 27 28 29 30 31); %dostates(32 33 34 35 36 37 38 39 40 41 42); %dostates(44 45 46 47 48 49 50 53 54 55 56); %dostates(51 72); %dostates(10 11); ========================== end comment */ %dostates(n=52);