/* SAS code to produce drill down map for each county in Kansas. Each page contains the outline of the cities within that county. When a city is selected (by clicking) the user is taken (via the use of a perl script) to a page displaying data items and reports for that city.*/ /* 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 tiger 'd:\data\tiger\'; filename ODSOUT "d:\data\tiger\"; /* format for city names */ proc format; value ctyfmt 101='Abbyville' 126-128='Abilene' 326='Admire' 476='Agenda' 551='Agra' 826='Albert' 951='Alden' 1051='Alexander' 1276='Allen' 1351-1352='Alma' 1426='Almena' 1551-1559='Altamont' 1576='Alta Vista' 1601='Alton' 1626='Altoona' 1676='Americus' 1776='Andale' 1801-1805='Andover' 1976='Anthony' 2176='Arcadia' 2251='Argonia' 2301-2306='Arkansas City' 2326='Arlington' 2376-2377='Arma' 2676='Ashland' 2851='Assaria' 2901-2914='Atchison' 3026='Athol' 3051='Atlanta' 3101='Attica' 3151='Atwood' 3251='Auburn' 3301-3306='Augusta' 3426='Aurora' 3601='Axtell' 3901-3903='Baldwin City' 4226='Barnard' 4251='Barnes' 4351='Bartlett' 4401='Basehor' 4451-4452='Bassett' 4626-4628='Baxter Springs' 4776='Bazine' 4901='Beattie' 5338='Bel Aire' 5501='Belle Plaine' 5601-5604='Belleville' 5776-5778='Beloit' 5826='Belpre' 5926='Belvue' 6001='Benedict' 6076='Bennington' 6126='Bentley' 6176='Benton' 6276='Bern' 6501='Beverly' 6826='Bird City' 6951='Bison' 7601='Blue Mound' 7651='Blue Rapids' 7776='Bluff City' 7826='Bogue' 7976='Bonner Springs' 8426='Brewster' 8476='Bronson' 8576='Brookville' 8676='Brownell' 9001-9002='Bucklin' 9151='Buffalo' 9201='Buhler' 9226='Bunker Hill' 9251='Burden' 9276='Burdett' 9351='Burlingame' 9401-9404='Burlington' 9451-9452='Burns' 9526='Burr Oak' 9576='Burrton' 9676='Bushong' 9701='Bushton' 9801='Byers' 9901='Caldwell' 10126='Cambridge' 10176='Camp Forsyth CDP' 10376-10378='Caney' 10476='Canton' 10601='Carbondale' 10676='Carlton' 10926='Cassoday' 11176='Cawker City' 11326='Cedar' 11426='Cedar Point' 11451='Cedar Vale' 12426='Centralia' 12501-12504='Chanute' 12551='Chapman' 12651='Chase' 12676='Chautauqua' 12776-12778='Cheney' 12826='Cherokee' 12926='Cherryvale' 12951='Chetopa' 13276-13282='Cimarron' 13376='Circleville' 13426='Claflin' 13626-13628='Clay Center' 13676='Clayton' 13926='Clearwater' 14201='Clifton' 14276='Climax' 14476='Clyde' 14526='Coats' 14601-14604='Coffeyville' 14651-14654='Colby' 14701='Coldwater' 14901='Collyer' 14951='Colony' 15076-15078='Columbus' 15101-15103='Colwich' 15201-15203='Concordia' 15326-15332='Conway Springs' 15401='Coolidge' 15476='Copeland' 15726='Corning' 15901='Cottonwood Falls' 15926='Council Grove' 15976='Countryside' 16026='Courtland' 16151='Coyville' 16626='Cuba' 16676='Cullison' 16701='Culver' 16776='Cunningham' 16976='Damar' 17001='Danville' 17151='Dearing' 17226='Deerfield' 17526='Delia' 17601-17602='Delphos' 17626='Denison' 17751='Denton' 17801-17809='Derby' 17851-17856='De Soto' 17926='Dexter' 18051='Dighton' 18251-18256='Dodge City' 18299='Doniphan' 18326='Dorrance' 18401-18402='Douglass' 18501='Downs' 18601='Dresden' 18951='Dunlap' 19051='Durham' 19126='Dwight' 19276='Earlton' 19301='Eastborough' 19601='Easton' 19826-19828='Edgerton' 19876='Edmond' 19901-19902='Edna' 20001='Edwardsville' 20026='Effingham' 20051='Elbing' 20076-20082='El Dorado' 20099='El Paso' 20126='Elgin' 20251='Elk City' 20301='Elk Falls' 20351='Elkhart' 20426='Ellinwood' 20451='Ellis' 20501-20502='Ellsworth' 20676='Elmdale' 20876-20877='Elsmore' 20951='Elwood' 21101='Emmett' 21276-21279='Emporia' 21351='Englewood' 21401='Ensign' 21426='Enterprise' 21501-21503='Erie' 21601='Esbon' 21651='Eskridge' 21676-21677='Eudora' 21801='Eureka' 22026='Everest' 22426='Fairview' 22701='Fairway' 22776='Fall River' 23601-23602='Florence' 23651='Fontana' 23726='Ford' 23826='Formoso' 23981='Fort Riley-Camp Whiteside CDP' 23991='Fort Riley North CDP' 24001-24009='Fort Scott' 24176='Fowler' 24276='Frankfort' 24551='Frederick' 24576-24577='Fredonia' 24726='Freeport' 24851-24853='Frontenac' 24926='Fulton' 25051='Galatia' 25101-25106='Galena' 25151='Galesburg' 25201='Galva' 25326-25329='Garden City' 25376='Garden Plain' 25426-25432='Gardner' 25751='Garfield' 25926-25928='Garnett' 25976-25977='Gas' 26001='Gaylord' 26051='Gem' 26076='Geneseo' 26201-26202='Geuda Springs' 26301-26303='Girard' 26326='Glade' 26376='Glasco' 26501='Glen Elder' 26726-26727='Goddard' 26751='Goessel' 26776='Goff' 26876-26878='Goodland' 27001='Gorham' 27126='Gove City' 27201='Grainfield' 27426='Grandview Plaza' 28301-28305='Great Bend' 28351='Greeley' 28426='Green' 28626='Greenleaf' 28676='Greensburg' 28801-28802='Grenola' 28851-28852='Gridley' 28901-28902='Grinnell' 29251='Gypsum' 29401='Haddam' 29601='Halstead' 29676='Hamilton' 29701='Hamlin' 29876-29878='Hanover' 29926='Hanston' 30001='Hardtner' 30176='Harper' 30251='Harris' 30476='Hartford' 30576='Harveyville' 30701='Havana' 30726='Haven' 30776='Havensville' 30826='Haviland' 31101-31106='Hays' 31126='Haysville' 31151='Hazelton' 31376='Hepler' 31401-31402='Herington' 31476='Herndon' 31601-31602='Hesston' 31676-31678='Hiawatha' 31851='Highland' 32176='Hill City' 32276-32278='Hillsboro' 32299='Hillsdale' 32551-32552='Hoisington' 32576='Holcomb' 32651='Hollenberg' 32699='Holmdel Gardens' 32826-32828='Holton' 32851='Holyrood' 33076='Hope' 33151='Horace' 33201-33203='Horton' 33251='Howard' 33351='Hoxie' 33376='Hoyt' 33401='Hudson' 33426='Hugoton' 33451-33452='Humboldt' 33501='Hunnewell' 33526='Hunter' 33576='Huron' 33626-33631='Hutchinson' 33876-33878='Independence' 34226='Ingalls' 34276='Inman' 34301-34304='Iola' 34551='Isabel' 34626='Iuka' 34976='Jamestown' 35376='Jennings' 35451='Jetmore' 35476='Jewell' 35601='Johnson City' 35751-35763='Junction City' 35951='Kanopolis' 35976='Kanorado' 36001='Kansas City' 36226='Kechi' 36551='Kensington' 36876='Kincaid' 36951-36953='Kingman' 37076-37077='Kinsley' 37126='Kiowa' 37276='Kirwin' 37326='Kismet' 37376='Labette' 37501='La Crosse' 37576='La Cygne' 37726='La Harpe' 37976='Lake Quivira' 38176='Lakin' 38326='Lancaster' 38401='Lane' 38501='Langdon' 38651-38652='Lansing' 38701-38702='Larned' 38776='Latham' 38801='Latimer' 38901-38918='Lawrence' 39001-39002='Leavenworth' 39076='Leawood' 39101='Lebanon' 39126-39129='Lebo' 39151='Lecompton' 39226='Lehigh' 39351-39352='Lenexa' 39401='Lenora' 39451-39453='Leon' 39476='Leona' 39501='Leonardville' 39551-39553='Leoti' 39651='Le Roy' 39726='Lewis' 39826-39828='Liberal' 40251='Liberty' 40401='Liebenthal' 41301-41303='Lincoln Center' 41326='Lincolnville' 41376='Lindsborg' 41426-41427='Linn' 41466='Linn Valley' 41476='Linwood' 41576='Little River' 42101='Logan' 42426='Lone Elm' 42576='Longford' 42601='Long Island' 42651-42652='Longton' 42801='Lorraine' 42826='Lost Springs' 42876-42879='Louisburg' 42926='Louisville' 43151='Lucas' 43251-43252='Luray' 43351='Lyndon' 43526='Lyons' 43701='McCracken' 43726='McCune' 43751='McDonald' 43776='McFarland' 43851='Macksville' 43901='McLouth' 43951-43953='McPherson' 44051='Madison' 44151='Mahaska' 44201-44203='Maize' 44226='Manchester' 44251-44262='Manhattan' 44301='Mankato' 44376='Manter' 44501='Maple Hill' 44551='Mapleton' 44751-44752='Marion' 44926='Marquette' 45051-45054='Marysville' 45151='Matfield Green' 45251='Mayetta' 45276='Mayfield' 45326-45328='Meade' 45501-45502='Medicine Lodge' 45701='Melvern' 45751='Menlo' 45951='Meriden' 46001='Merriam' 46451='Milan' 46501='Mildred' 46526-46527='Milford' 46951-46952='Miltonvale' 47076-47077='Minneapolis' 47151='Minneola' 47226='Mission' 47351='Mission Hills' 47426='Mission Woods' 47601='Moline' 47876-47877='Montezuma' 48126='Moran' 48226='Morganville' 48276='Morland' 48301='Morrill' 48451='Morrowville' 48601='Moscow' 48751-48754='Mound City' 48801-48806='Moundridge' 48826='Mound Valley' 48901-48903='Mount Hope' 49026='Mulberry' 49076='Mullinville' 49101-49102='Mulvane' 49151='Munden' 49326='Muscotah' 49351='Narka' 49401='Nashville' 49426='Natoma' 49651-49652='Neodesha' 49826='Neosho Falls' 49876='Neosho Rapids' 49926='Ness City' 49951='Netawaka' 50151='New Albany' 50301='New Cambria' 50451='New Strawn' 50476-50479='Newton' 50526='Nickerson' 50751='Niotaze' 50926='Norcatur' 51226='North Newton' 51501='Norton' 51526='Nortonville' 51601-51602='Norwich' 51701='Oak Hill' 51811='Oaklawn-Sunview CDP' 51826-51827='Oakley' 52001-52002='Oberlin' 52201='Offerle' 52276-52277='Ogden' 52526='Oketo' 52576-52626='Olathe' 52701='Olivet' 52751='Olmitz' 52801='Olpe' 52826-52827='Olsburg' 52876-52877='Onaga' 52901='Oneida' 53201='Osage City' 53226-53232='Osawatomie' 53326='Osborne' 53376='Oskaloosa' 53451='Oswego' 53526='Otis' 53551-53555='Ottawa' 53726-53728='Overbrook' 53776-53780='Overland Park' 53851='Oxford' 53926='Ozawkie' 54126='Palco' 54201='Palmer' 54251-54255='Paola' 54326='Paradise' 54401='Park' 54451-54455='Park City' 54501-54502='Parker' 54576='Parkerville' 54676-54680='Parsons' 54701='Partridge' 54876='Pawnee Rock' 54951='Paxico' 55101='Peabody' 55226='Penalosa' 55451='Perry' 55526='Peru' 55676-55677='Phillipsburg' 56026-56027='Pittsburg' 56101='Plains City' 56151-56152='Plainville' 56451-56452='Pleasanton' 56726='Plevna' 57001='Pomona' 57101='Portis' 57301-57302='Potwin' 57351='Powhattan' 57526='Prairie View' 57576='Prairie Village' 57626-57631='Pratt' 57651='Prescott' 57676='Preston' 57701-57703='Pretty Prairie' 57726='Princeton' 57851='Protection' 58101='Quenemo' 58251-58252='Quinter' 58301='Radium' 58376='Ramona' 58451='Randall' 58476='Randolph' 58501-58502='Ransom' 58526='Rantoul' 58551='Raymond' 58601='Reading' 58726='Redfield' 59001='Republic' 59051='Reserve' 59126='Rexford' 59201='Richfield' 59676='Richmond' 59876-59877='Riley' 60326='Robinson' 60826='Roeland Park' 60901='Rolla' 60999='Rosalia' 61251-61256='Rose Hill' 61276='Roseland' 61401='Rossville' 61601='Rozel' 61776='Rush Center' 61826-61828='Russell' 61876='Russell Springs' 62026-62030='Sabetha' 62176='St. Francis' 62201='St. George' 62276='St. John' 62401-62402='St. Marys' 62501='St. Paul' 62701-62709='Salina' 63151='Satanta' 63201='Savonburg' 63276-63277='Sawyer' 63326='Scammon' 63351='Scandia' 63426='Schoenchen' 63601-63602='Scott City' 63651='Scottsville' 63676='Scranton' 63751='Sedan' 63800-63802='Sedgwick' 63876='Selden' 63951-63952='Seneca' 64026='Severance' 64051='Severy' 64101='Seward' 64326-64327='Sharon' 64376='Sharon Springs' 64501-64502='Shawnee' 65601='Silver Lake' 65651='Simpson' 65926='Smith Center' 66101='Smolan' 66176='Soldier' 66276='Solomon' 66651='South Haven' 66751='South Hutchinson' 67126='Spearville' 67176='Speed' 67251='Spivey' 67626-67630='Spring Hill' 67776='Stafford' 68026='Stark' 68201-68202='Sterling' 68351='Stockton' 68626='Strong City' 68776='Sublette' 68951='Summerfield' 69276='Sun City' 69526='Susank' 69776='Sylvan Grove' 69801='Sylvia' 69851-69852='Syracuse' 70001='Tampa' 70251='Tescott' 70301-70302='Thayer' 70626='Timken' 70676='Tipton' 70801-70802='Tonganoxie' 71001-71007='Topeka' 71051='Toronto' 71126-71128='Towanda' 71351='Treece' 71451='Tribune' 71576-71582='Troy' 71801='Turon' 71926='Tyro' 71951='Udall' 71976-71977='Ulysses' 72526='Uniontown' 72651='Utica' 73251-73256='Valley Center' 73301='Valley Falls' 73526='Vermillion' 73776='Victoria' 73951='Vining' 74026='Viola' 74076='Virgil' 74451='Wakeeney' 74526-74527='Wakefield' 74576='Waldo' 74626='Waldron' 74751='Wallace' 74951='Walnut' 75201='Walton' 75326='Wamego' 75826-75828='Washington' 75951-75955='Waterville' 76001='Wathena' 76051-76052='Waverly' 76251='Webber' 76351-76352='Weir' 76476-76478='Wellington' 76626='Wellsville' 77151-77152='West Mineral' 77201-77202='Westmoreland' 77251='Westphalia' 77501='Westwood' 77526='Westwood Hills' 77551='Wetmore' 77701='Wheaton' 77826='White City' 77851='White Cloud' 78051='Whitewater' 78101='Whiting' 79001-79044='Wichita' 79251='Willard' 79301='Williamsburg' 79401='Willis' 79426='Willowbrook' 79551='Wilmore' 79651='Wilsey' 79676='Wilson' 79801='Winchester' 79851='Windom' 79951-79953='Winfield' 80076='Winona' 80351='Woodbine' 80451='Woodston' 80701-80702='Yates Center' 80926='Zenda' 81026='Zurich'; /*This macro is used to produce one html page for each county. */ %macro mymac(geo); ods listing close; ods html file="&geo..html" path=ODSOUT archive='http://www.ku.edu/pri/ksdata/sashttp/java/mapapp.jar' parameters=("DRILLDOWNMODE"="HTML") parameters=("DRILLPATTERN"='http://www.ku.edu/cgiwrap/ippbrwww/city.pl?cityfips={&txtplace}') parameters=("BACKCOLOR"="FFFFFF"); goptions reset=all dev=java xpixels=500 ypixels=350 cback=white border gunit=pct htext=3 colors=(cx6600FF cx6633FF cx6666CC cx6633CC cx3333CC cx3300CC cx6699FF cx99CCFF cx6699FF cxCCCCCC cx999999); data temp; set tiger.city&geo.; /*data set contain Census TIGER data for every city in Kansas*/ length idvar 8 place 8.0 txtplace $8 fullgeo 5 txtgeo $25; place=2000000+placer; txtplace=put(place, z7.); fullgeo=20000+geo; select (type); when ("place") idvar=placer+segment; when ("county") idvar=((20000+geo)*10)+segment; otherwise; end; select (fullgeo); when (20001) txtgeo='Allen County'; when (20003) txtgeo='Anderson County'; when (20005) txtgeo='Atchison County'; when (20007) txtgeo='Barber County'; when (20009) txtgeo='Barton County'; when (20011) txtgeo='Bourbon County'; when (20013) txtgeo='Brown County'; when (20015) txtgeo='Butler County'; when (20017) txtgeo='Chase County'; when (20019) txtgeo='Chautauqua County'; when (20021) txtgeo='Cherokee County'; when (20023) txtgeo='Cheyenne County'; when (20025) txtgeo='Clark County'; when (20027) txtgeo='Clay County'; when (20029) txtgeo='Cloud County'; when (20031) txtgeo='Coffey County'; when (20033) txtgeo='Comanche County'; when (20035) txtgeo='Cowley County'; when (20037) txtgeo='Crawford County'; when (20039) txtgeo='Decatur County'; when (20041) txtgeo='Dickinson County'; when (20043) txtgeo='Doniphan County'; when (20045) txtgeo='Douglas County'; when (20047) txtgeo='Edwards County'; when (20049) txtgeo='Elk County'; when (20051) txtgeo='Ellis County'; when (20053) txtgeo='Ellsworth County'; when (20055) txtgeo='Finney County'; when (20057) txtgeo='Ford County'; when (20059) txtgeo='Franklin County'; when (20061) txtgeo='Geary County'; when (20063) txtgeo='Gove County'; when (20065) txtgeo='Graham County'; when (20067) txtgeo='Grant County'; when (20069) txtgeo='Gray County'; when (20071) txtgeo='Greeley County'; when (20073) txtgeo='Greenwood County'; when (20075) txtgeo='Hamilton County'; when (20077) txtgeo='Harper County'; when (20079) txtgeo='Harvey County'; when (20081) txtgeo='Haskell County'; when (20083) txtgeo='Hodgeman County'; when (20085) txtgeo='Jackson County'; when (20087) txtgeo='Jefferson County'; when (20089) txtgeo='Jewell County'; when (20091) txtgeo='Johnson County'; when (20093) txtgeo='Kearny County'; when (20095) txtgeo='Kingman County'; when (20097) txtgeo='Kiowa County'; when (20099) txtgeo='Labette County'; when (20101) txtgeo='Lane County'; when (20103) txtgeo='Leavenworth County'; when (20105) txtgeo='Lincoln County'; when (20107) txtgeo='Linn County'; when (20109) txtgeo='Logan County'; when (20111) txtgeo='Lyon County'; when (20113) txtgeo='McPherson County'; when (20115) txtgeo='Marion County'; when (20117) txtgeo='Marshall County'; when (20119) txtgeo='Meade County'; when (20121) txtgeo='Miami County'; when (20123) txtgeo='Mitchell County'; when (20125) txtgeo='Montgomery County'; when (20127) txtgeo='Morris County'; when (20129) txtgeo='Morton County'; when (20131) txtgeo='Nemaha County'; when (20133) txtgeo='Neosho County'; when (20135) txtgeo='Ness County'; when (20137) txtgeo='Norton County'; when (20139) txtgeo='Osage County'; when (20141) txtgeo='Osborne County'; when (20143) txtgeo='Ottawa County'; when (20145) txtgeo='Pawnee County'; when (20147) txtgeo='Phillips County'; when (20149) txtgeo='Pottawatomie County'; when (20151) txtgeo='Pratt County'; when (20153) txtgeo='Rawlins County'; when (20155) txtgeo='Reno County'; when (20157) txtgeo='Republic County'; when (20159) txtgeo='Rice County'; when (20161) txtgeo='Riley County'; when (20163) txtgeo='Rooks County'; when (20165) txtgeo='Rush County'; when (20167) txtgeo='Russell County'; when (20169) txtgeo='Saline County'; when (20171) txtgeo='Scott County'; when (20173) txtgeo='Sedgwick County'; when (20175) txtgeo='Seward County'; when (20177) txtgeo='Shawnee County'; when (20179) txtgeo='Sheridan County'; when (20181) txtgeo='Sherman County'; when (20183) txtgeo='Smith County'; when (20185) txtgeo='Stafford County'; when (20187) txtgeo='Stanton County'; when (20189) txtgeo='Stevens County'; when (20191) txtgeo='Sumner County'; when (20193) txtgeo='Thomas County'; when (20195) txtgeo='Trego County'; when (20197) txtgeo='Wabaunsee County'; when (20199) txtgeo='Wallace County'; when (20201) txtgeo='Washington County'; when (20203) txtgeo='Wichita County'; when (20205) txtgeo='Wilson County'; when (20207) txtgeo='Woodson County'; when (20209) txtgeo='Wyandotte County'; otherwise; end; drop tlid; format idvar ctyfmt.; call symput ('fgeo', txtgeo); /*This makes fgeo a macro variable for use in the title*/ run; title "Cities within &fgeo."; title2 'Click on a city to view available data items.'; proc gmap map=temp data=temp; id idvar; choro txtplace/discrete nolegend coutline=black; run; quit; ods html close; ods listing; quit; %mend; /* macro that will send the geocode of each county to the macro above*/ %macro runall; %do ixc=20001 %TO 20209 %by 2; %mymac(geo=&ixc); %end; %mend; %runall