/* Update the mable09 datasets and views used by the geocorr 2000 web application. Adding 110th Congressional Districts, October 20, 2026. For most states these are the same as 109th CDs. */ %include '/pub/sas/autoexec.sas'; options fmtsearch=(mableo9 sasctlgs); options nosource nosource2 nomprint nomlogic nosymbolgen notes; libname mable09 '/pub/data/mable09'; libname mable2k '/pub/data/mable09' access=readonly; libname updates '/pub/data/mable09/updates' access=readonly; %macro doit(state,stab); PROC SQL; CREATE TABLE &stab.v3 AS SELECT t1.County, t1.Tract, t1.Block, t1.Cnty, t1.CntySC, t1.CouSubFP, t1.PlaceFP, t1.PlaceSC, t1.BG, t1.cd106, t1.sldu, t1.sldl, t1.vtd, t1.ZCTA5, t1.pop2k, t1.hus2k, t1.IntPtLat, t1.IntPtLon, t1.SDElm, t1.SDSec, t1.SDUni, t1.TAZ, t1.LandSQMI, t1.AreaSQMI, t1.PopDen, t1.placece, t1.cousubce, t1.InPlace, t1.ur, t1.ur90, t1.puma5, t1.ua, t1.ur00cor, t1.ua00cor, t1.ua90red, t1.ur90red, t1.cd108, t1.ua90, t1.cd109, t1.cd109 label="Cong District - 110th" as cd110, t1.sldu02, t1.sldl02, t1.necta, t1.nectadiv, t1.county02, t1.state, t1.Stab, t1.Region, t1.Division, t1.MSACMSA, t1.MASC, t1.CMSA2, t1.PMSA, t1.NECMA, t1.CoFuncStat, t1.CoPop2k, t1.CoHUS2k, t1.CoLsadc, t1.cbsa, t1.metrodiv, t1.cbsatype, t1.cbsayr, t1.csa, t1.ui_code, t1.beale93, t1.beale03, t1.PopJL09, t1.PopGrowthFactor FROM mable09.&stab.v3 t1 ; QUIT; data mable09.&stab.v3; set &stab.v3; run; /* PROC SQL; CREATE TABLE &stab.blks07 AS SELECT t1.County, t1.Tract, t1.Block, t1.Cnty, t1.CntySC, t1.CouSubFP, t1.PlaceFP, t1.PlaceSC, t1.BG, t1.cd106, t1.sldu, t1.sldl, t1.vtd, t1.ZCTA5, t1.pop2k, t1.hus2k, t1.IntPtLat, t1.IntPtLon, t1.SDElm, t1.SDSec, t1.SDUni, t1.TAZ, t1.LandSQMI, t1.AreaSQMI, t1.PopDen, t1.placece, t1.cousubce, t1.InPlace, t1.ur, t1.ur90, t1.puma5, t1.ua, t1.ur00cor, t1.ua00cor, t1.ua90red, t1.ur90red, t1.cd108, t1.ua90, t1.cd109, t1.cd109 label="Cong District - 110th" as cd110, t1.sldu02, t1.sldl02, t1.necta, t1.nectadiv FROM mable09.&stab.blks07 t1 ; QUIT; PROC SQL; CREATE TABLE &stab.blks07 AS SELECT t1.County, t1.Tract, t1.Block, t1.Cnty, t1.CntySC, t1.CouSubFP, t1.PlaceFP, t1.PlaceSC, t1.BG, t1.cd106, t1.sldu, t1.sldl, t1.vtd, t1.ZCTA5, t1.pop2k, t1.hus2k, t1.IntPtLat, t1.IntPtLon, t1.SDElm, t1.SDSec, t1.SDUni, t1.TAZ, t1.LandSQMI, t1.AreaSQMI, t1.PopDen, t1.placece, t1.cousubce, t1.InPlace, t1.ur, t1.ur90, t1.puma5, t1.ua, t1.ur00cor, t1.ua00cor, t1.ua90red, t1.ur90red, t1.cd108, t1.ua90, t1.cd109, t2.cd110 label="Cong District - 110th" as cd110, t1.sldu02, t1.sldl02, t1.necta, t1.nectadiv FROM mable09.&stab.blks07 t1 LEFT JOIN updates.cd110_fixes t2 ON ( t1.county = t2.county and t1.tract = t2.tract and t1.block = t2.block ) ; QUIT; data mable09.&stab.blks07; set &stab.blks07; run; data mable09.&stab.v3(label="All variables for &stab rev. to 08")/view=mable09.&stab.v3; set mable09.&stab.blks07; by county; county02=county; if county='51560' then county02='51005'; else if state='08' and placefp='09280' then county02='08014'; else if state='02' and county='02232' then do; if placefp='70760' then county02='02230'; else county02='02105'; end; if first.county then do; set mable2k.&stab.cocds1( rename=(county=countyck)); set mable09.&stab.cocds2(rename=(county=countyck2)); end; if cbsa='99999' then cbsa=' '; if county ne countyck then do; abort 600; end; if county ne countyck2 then do; abort 601; end; drop countyck countyck2; format county $5.; run; */ %mend doit; /* begin comment ==================================== %dostates(n=52); %dostates(13 48); * GA, TX ; ========================== end comment */ %dostates(02 08 51);