x cd /pub/data/corrlst/Tools; %let pgm=usslds12_14; filename pgm "&pgm..sas"; *--We ran Geocorr 11-19-15 to relate the 2012 vintage state legislative districts for 2012 vs 2014 as stored in the mable14 data base. Here we save the output from that run and generate 2 reports showing what changed over that period. jgb, 11-19-15 ---*; filename inu '/pub/data/corrlst/ussldu12_14.csv'; filename inl '/pub/data/corrlst/ussldl12_14.csv'; libname corrlst '/pub/data/corrlst'; ods html file="&pgm._upper.html"; data corrlst.ussldu12_14(label="US sld upper chamber 2012 to 2014, where not the same"); infile inu dsd firstobs=3; length State $2 sldu12 sldu14 $3 Pop10 5 afact 4; input state--afact; if _n_=1 then put _all_; if sldu12=sldu14 and afact=1 then delete; *--even if it is nearly a 1-to-1 we want to keep it if the code changed--; if afact > .99 and sldu12 ne sldu14 then; else if (afact > .99 or afact < .01) then delete; *--trivail sliver changes--; run; proc print data=corrlst.ussldu12_14; by state sldu12; id state sldu12; var sldu14 pop10 afact; format state $state. afact 5.3; title "Signficant Changes in Upper Chamber SLDs Between 2012 and 2014"; run; ods html close; ods html file="&pgm._lower.html"; data corrlst.ussldl12_14(label="US sld lower chamber 2012 to 2014, where not the same"); infile inl dsd firstobs=3; length State $2 sldl12 sldl14 $3 Pop10 5 afact 4; input state--afact; if _n_=1 then put _all_; if sldl12=sldl14 and afact=1 then delete; *--even if it is nearly a 1-to-1 we want to keep it if the code changed--; if afact > .99 and sldl12 ne sldl14 then; else if (afact > .99 or afact < .01) then delete; *--trivial sliver changes--; run; proc print data=corrlst.ussldl12_14; by state sldl12; id state sldl12; var sldl14 pop10 afact; format state $state. afact 5.3; title "Significant Changes in Lower Chamber SLDs Between 2012 and 2014"; run; ods html close;