/* This code graphs 2000 Population by Congressional District. Output is an activex prism map in html */ /* If you have questions, please contact: Xanthippe Stevens Information Specialist The University of Kansas Policy Research Institute 1541 Lilac Lane, Suite 607 Lawrence, KS 66044 (785) 864-9111 xan@ku.edu */ libname data 'd:\data\census\2000\redist\'; /*2000 Census data by Congressional Dist.*/ libname tiger 'd:\data\tiger\'; /*Tiger data */ filename ODSOUT 'd:\data\census\2000\'; %let varname=TOTPOP2000; data temp; set data.Fourdistdata; length cdist 8; if name="Congressional District 1" then cdist=1; if name="Congressional District 2" then cdist=2; if name="Congressional District 3" then cdist=3; if name="Congressional District 4" then cdist=4; output; run; data mapset; /*Built in SAS data set containing map points for Counties*/ set maps.uscounty; where state=20; length fips 8; fips=county+20000; run; proc sql; create table ksmap as select a.*, b.cdist from mapset as a, data.dist as b where a.fips=b.fips; delete from ksmap where fips=20045 and cdist=2; /*Remove the portion of Douglas County that is in District Two*/ delete from ksmap where fips=20115 and cdist=4; /*Remove the portion of Marion County that is in District Four*/ create table ksdata as select a.*, b.totpop2000, b.spanish2000, b.age18ovr2000 from ksmap as a, temp as b where a.cdist=b.cdist; quit; goptions reset=global colors=(black) device=activex transparency; pattern1 color=cx6699FF value=msolid; /*BLUE*/ pattern2 color=cx99FF99 value=msolid; /*GREEN*/ pattern3 color=cxFFFF66 value=msolid; /*YELLOW*/ pattern4 color=cxFF9999 value=msolid; /*RED*/ ods html body="&varname..html" path=ODSOUT; proc gmap map=mapset data=ksdata; id fips; prism &varname./discrete nolegend coutline=black; run; quit; ods html close;