x cd /pub/data/georef/Tools; %let pgm=gen_usbbbb2020; filename pgm "&pgm..sas"; /* Generate georef.usbbbb2020: a data set containing block-based bounding box data for all US states and counties. We plan to access this data set in our 2020 (and later) vintage CAPS apps that use it to restrict searches to specific states and counties based on their bounding box coordinates. We use the block-level data from pl94 to get coordinates for blocks. */ %include '/pub/sas/autoexec.sas'; libname pl942020 '/pub/data/pl942020' access=readonly; libname georef '/pub/data/georef'; %macro doit(state,stab); proc summary data=pl942020.&stab.sums(keep=sumlev state county intptlat intptlon where=(sumlev='750')); by state; class county; var intptlat intptlon; output out=&stab.boxes(drop=_type_ _freq_) min=minlat minlon max=maxlat maxlon; run; %mend doit; %dostates(n=52); %macro refset(state,stab); &stab.boxes %mend refset; data usbbbb2020; set %dostates(n=52,mac=refset) open=defer; if county=' ' then SumLev='040'; else SumLev='050'; run; data CT_only; set georef.usbbbb2020; if county =: '091'; run; data georef.usbbbb2020_new(label="Bounding boxes for US states and counties, per 2020 pl94"); set usbbbb2020 CT_only; run; proc sort; by state sumlev county; run;