x cd /pub/data/corrlst/Tools; %let pgm=mistr0802k_sld02; filename pgm "&pgm..sas"; *----Generates the 3 correlation lists linking the 080 split-tract summary level with the 3 leg district levels for the state of Michigan. Borrowing setup from the agg setup for Michigan sf32000 data where we did something comparable for the sf3 split-tract level (085 - include Urban/Rural which was not available for SF1). We tried using that correlation list to agg. sf1 data and of course got bogus results. Doing this as part of contract work for the state of Michigan . ----*; libname mable2k '/pub/data/mable2k' access=readonly; libname corrlst '/pub/data/corrlst'; libname user '/SAS_temp/user'; options msglevel=i; title "&pgm: Generate Correlation Lists from 1990 080 Summary Level Codes to 2002 Michigan Legislative Districts"; *---We have 2 versions of the sbg_geos list because we called the urban-rural var on mable2k ur and called it urbanrur on the sfs; %let str_geos=county cousubfp placefp tract ; *<---geocodes comprising the "split tract" -SumLev 080-; /*<=========================Comment out===================================== *---Merge the correlation list provided by the Michigan SDC with additional geocodes from the mable2k database---; data miblocks; merge corrlst.mibl2slds02(in=in1 rename=(sldl=sldl02 sldu=sldu02)) mable2k.miv(keep=&str_geos block pop2k in=in2 ) ; by county tract block; format tract ; if not (in1 and in2) then do; if not in1 and pop2k=0 then delete; put '***Block missing from one of the sets**** ' in1= in2= county= tract= block=; _nbad+1; drop _nbad; if _nbad gt 10 then abort abend; delete; end; run; proc datasets library=user nolist; modify miblocks; index create geossldl=(&str_geos sldl02); index create geossldu=(&str_geos sldu02); index create geoscd108=(&str_geos cd108); quit; ===========================End commented out================================ */ *---In the steps below we use the miblocks dataset as the setin each time but SAS will choose the apprriate index to use to access the set in the appropriatge order each time. ---; %let clist=mistr0802k_cd108; *---create corrlst.&clist--- 108th congressional districts; %corrwt(setin=miblocks,setout=corrlst.&clist, geocds1=&str_geos, geocds2=cd108, weight=pop2k, keepwt=1); proc print data=corrlst.&clist(obs=50); title3 "Sample Obs from corrlst.&clist"; by county; run; %let clist=mistr0802k_sldl02; *---create corrlst.&clist--- redrawn state House districts; %corrwt(setin=miblocks,setout=corrlst.&clist, geocds1=&str_geos, geocds2=sldl02, weight=pop2k, keepwt=1); proc print data=corrlst.&clist(obs=50); title3 "Sample Obs from corrlst.&clist"; by county; run; %let clist=mistr0802k_sldu02; *---create corrlst.&clist--- redrawn state Senate districts; %corrwt(setin=miblocks,setout=corrlst.&clist, geocds1=&str_geos, geocds2=sldu02, weight=pop2k, keepwt=1); proc print data=corrlst.&clist(obs=100); title3 "Sample Obs from corrlst.&clist"; by county; run;