/* Update the mable22 datasets and views used by the geocorr 2022 web application. CBSAs update, Dec. 2023. */ %include '/pub/sas/autoexec.sas'; options fmtsearch=(mable22 sasctlgs); options nosource nosource2 nomprint nomlogic nosymbolgen notes; libname mable22 '/pub/data/mable22'; %macro doit(state,stab); PROC SQL; CREATE TABLE &stab._counties AS SELECT t1.State, t1.Stab, t1.County, t1.County3, t1.Region, t1.Division, t1.CBSA20, t1.CBSAType20, t1.CSA20, t1.Metdiv20, (CASE WHEN t2.county IS MISSING THEN '99999' ELSE t2.CBSA23 END) LABEL="Core-based statistical area code (2023)" AS CBSA23, t2.CBSAType23 LABEL="CBSA type (2023)", t2.CBSACentral23 LABEL="Central county of CBSA (2023)", (CASE WHEN t2.county IS MISSING THEN '999' ELSE t2.CSA23 END) LABEL="Combined statistical area code (2023)" AS CSA23, (CASE WHEN t2.county IS MISSING THEN '99999' ELSE t2.Metdiv23 END) LABEL="Metorpolitan division (2023)" AS Metdiv23, t1.LSAD, t1.FuncStat, t1.CtyPop20, t1.CtyHUs FROM mable22.&stab._counties t1 LEFT JOIN mable22.cbsas23_for_mable t2 ON (t1.county = t2.county); QUIT; data mable22.&stab._counties; set &stab._counties; run; * Create the views. ; data mable22.&stab.v/view=mable22.&stab.v; merge mable22.&stab._blocks mable22.&stab._counties ; by county; 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);