x cd /pub/data/corrlst/Tools; %let pgm=usco2puma; filename pgm "&pgm..sas"; *---Access previously created set of split-BG to puma level corr lists data sets to create a series of county to puma data sets. We hope to use this in order to determine if we can use the concept of "parent PUMAs" across the entire country the way we can in MO. jgb, 8/09. ---*; libname corrlst '/pub/data/corrlst'; libname temp '/pub/data/corrlst/temp'; libname popests '/pub/data/popests' access=readonly; options NOmprint; %let print=0; %let state=01; %let stab=al; %macro doit(state,stab); %corrwt(setin=corrlst.sbg2k_puma_&stab,setout=temp.&stab.co2k_puma,geocds1=county, geocds2=puma5, wtvar=pop2k,keepwt=1,afacts=2) data _null_; set temp.&stab.co2k_puma end=_last; by county; if first.county then _countypop=pop2k; else _countypop+pop2k; if last.county; if afact lt 1 and _countypop lt 65000 then do; file '../nopumparent.txt' mod; _nproblems+1; put county $5. +1 county $county32. +1 pop2k comma10. +1 afact 5.3 ; end; if _last then do; file print; put "**** " _nproblems " smaller counties in &statenm appear to not have a parent puma."; end; run; %if &print %then %do; title "&pgm.: &syslast"; proc print data=temp.&stab.co2k_puma; format afact afact2 5.3 pop2k comma9.; id county; run; %end; %mend doit; %dostates (n=51,names=1,msgs=1); %macro doit(state,stab); temp.&stab.co2k_puma %mend doit; data corrlst.usco2k_puma(label='County to PUMA equiv file as of 2k census'); length state $2; set %dostates(n=51) open=defer; state=substr(county,1,2); ***drop afact2; run;