x cd /pub/data/acs2007/Tools; %let pgm=usco2parentpuma; filename pgm "&pgm..sas"; *---Accessing the set of previously created 2000 county to PUMA equivalency data set in corrlst (setup in usco2puma in corrlst/Tools) we generate a single equivalency file for the entire US (excl. PR) linking US 2K counties to their "parent" or primary related PUMA. The PUMA on these 3141 obs represent the PUMA with which the county has the largest intersection. For smaller counties this is the "parent PUMA" that gets used in CPR estimation. All we really do here is add the size variable, which we shall need to do each new ACS year. I.e. we need to run this same setup for acs2008, acs2009, etc. jgb, 8/09. ---*; %let year=2007; %let yr=%substr(&year,3,2); **libname temp '/pub/data/corrlst/temp'; libname corrlst "/pub/data/corrlst"; libname acs "/pub/data/acs&year"; libname user '/SAS_temp/user'; options NOmprint; proc sort data=corrlst.usco2k_puma(drop=afact2) out=usco2k_puma; by state county descending afact; run; data acs.&pgm(label="Small & medium size county to parent PUMA " index=(state)); merge usco2k_puma(in=in2kdata) acs.usmcdcprofiles(in=in1yr keep=sumlev county where=(sumlev='050')) acs.usmcdcprofiles3yr(in=in3yr keep=sumlev county totpop where=(sumlev='050') rename=(totpop=totpop3yr)); by county; retain Year "&year"; if first.county; if in2kdata; *--for now we ignore any county that did not exist in 2000---; ****if in1yr then delete; *---these are too big---; if in3yr then do; size='m'; end; else size='s'; if in1yr then size='l'; else if afact lt 1 then put county= pop2k= afact= " ****county spans PUMAs***** "; drop sumlev; run; proc freq; table state*size; format state $state.; run;