/*--- Copy the base map to the WORK library ---*/ proc gis; copy MAPS.WAKE.TRACT.GISMAP / /* Map entry to copy */ destlib = WORK /* Destination library */ destcat = WORK.WAKE /* Destination catalog */ sel = (_all_) /* Copy all map components */ blank /* Clear internal map path */ replace; /* Overwrite existing entry */ quit; /*--- Create the address data set to geocode ---*/ data WORK.ADDRESSES (label='Data set to geocode'); input address $ 1-23 /* Street address */ resident $ 24-48 /* Person at the location */ zip $ 49-53 /* 5-digit US postal code */ city $ 55-69 /* City name */ state $ 70-71; /* US state name */ cards; 700 Madison Avenue Patricia Smith 27513 Cary 506 Reedy Creek Road Jean Francois Dumas 27513 Cary 1106 Medlin Drive Michael Garriss 27511 NC 1150 Maynard Road Kaspar Gutman 27511 Cary 138 Dry Ave. Susan Lang 27511 NC 3112 Banks Road Roy Hobbs 27603 Raleigh NC 305 Mill Creek Drive Alan Picard 27526 Fuquay-Varina NC 1998 S. Main St. Guillermo Ugarte Wake Forest 7825 Old Middlesex Rd Capt. Jeffrey Spaulding 27807 Bailey NC 5550 Old Stage Road Emily Joyner 27603 Raleigh NC 3212 Avent Ferry Road Fred C. Dobbs 27540 NC 1050 King Charles Rd. Karin Schmidt . Raleigh NC 6819 Buffaloe Road Ferdinand Paulin 27604 NC 3211 Constant Circle Gordon Miller 34121 6111 Old Faison Road Alan Picard 27545 Knightdale 725 N. Raleigh Street Evan Rudde 27501 Angier NC ; run; /*--- Set up variables for the Batch Geocoding program ---*/ %gcbatch( glib = WORK, /* Geocoding library */ geod = WORK.ADDRESSES, /* Address data to geocode */ nv = RESIDENT, /* Who's at the address */ av = ADDRESS, /* Address variable */ cv = CITY, /* Place name */ sv = STATE, /* State name */ zv = ZIP, /* ZIP code (5-digit) */ pv = TRACT, /* AREA value from map data */ mname = WORK.WAKE.TRACT); /* Map data used for geocoding */ /*--- Run the Batch Geocoding program ---*/ dm 'af cat=SASHELP.GIS.GEOCODEB.SCL'; /*--- Show geocoding results on a bar chart -------------------*/ axis1 label=(height=1.3 'Address Status'); axis2 label=(angle=-90 rotate=90 height=1.3 'Percent'); title1 "Geocoding Results"; title2 "Wake County, NC"; footnote1 j=l "Geocoded bySAS/GIS"; proc gchart data=WORK.ADDRESSES; /* Geocoded data set */ vbar _status_ / /* Midpoint (x-axis) variable */ descending /* Order of results */ type = pct /* Response (y-axis) variable */ outside = pct /* Label on top of bars */ inside = freq /* Label inside of bars */ maxis = axis1 /* x-axis */ raxis = axis2; /* y-axis */ run; quit; /*--- Set up Batch Import variables ---*/ %let imp_type = GENPOINT; /* Importing data as points */ %let maplib = WORK; /* Map library */ %let mapcat = WAKE; /* Map catalog */ %let mapname = TRACT; /* Map catalog entry */ %let spalib = WORK; /* Spatial data library */ %let spaname = WAKE; /* Spatial entry name */ %let cathow = UPDATE; /* Append existing entry */ %let spahow = APPEND; /* Append to spatial data sets */ %let nidvars = 0; /* Put points in one layer */ %let infile = WORK.ADDRESSES; /* Data set to import */ /*--- Run the Batch Import program ---*/ DM 'af cat=SASHELP.GISIMP.BATCH.SCL'; /*--- Modify imported layer and map with GIS Procedure ---*/ proc gis cat=WORK.WAKE; /*--- Set display parmameters for imported point layer */ layer update ADDRESSES / /* Geocoded layer */ type = point /* Layer type */ where = 'node=1' /* Layer definition */ des = 'Geocoded addresses' /* Label for entry */ default = (point=(color = yellow /* Symbol color */ font = marker /* Symbol font */ character = 'V' /* Symbol to use */ size = 10)); /* Symbol height */ /*--- Set display parmameters for the map */ map update TRACT / /* Map entry name */ layerson = (TRACT ADDRESSES) /* Turn on layers */ cback = gray /* Background color */ legend = hideall /* Turn off legend */ des = 'Wake County geocoding'; /* Label for entry */ /*--- Add label in lower right corner of the map */ maplabel create / text = 'Geocoding bySAS/GIS ' /* Label text */ map = WORK.WAKE.TRACT /* Map entry */ attach_to = window /* Do not pan label */ position = (bottom right) /* Window position */ color = cxA81010; /* Text color */ run; quit; /*--- Open map inSAS/GIS ---*/ dm 'gis map=WORK.WAKE.TRACT';
WHERE='NODE=1'
,
which displays points for all of the found addresses. You can modify
the WHERE clause to show only those addresses that were matched with
a higher degree of certainty (for example,.WHERE='_SCORE_>=40'
).