The GEOCODE Procedure |
Sample library member: | GEOSMPL |
The following sample shows the simplest form of the GEOCODE procedure specifying only the OUT= option to geocode by five-digit ZIP code. The default lookup data set, SASHELP.ZIPCODE, is used.
proc geocode out=geocoded_customers; run; proc print data=geocoded_customers noobs; run; |
The result of using all of the default values is that the following is true:
The input address data set is the most recently created SAS data set (this example assumes that you have just created WORK.CUSTOMERS).
The ZIP code geocoding method is used.
The lookup data set is SASHELP.ZIPCODE.
No variables are added to the output data set other than the X and Y coordinates, and a _MATCHED_ variable indicating whether and how the match was made.
The following output from PROC PRINT shows the output data set after running the GEOCODE procedure. Notice that the following geocoding variables have been added:
location coordinate variables X and Y from the lookup data set (SASHELP.ZIPCODE)
a variable named _MATCHED_ indicating whether the location was found by matching ZIP codes or by matching City and State (or whether no location was found because no match was made)
The GEOCODED_CUSTOMERS Data Set
Y X _MATCHED_ address zip city state cust_ID 34.0695 -118.398 City mean 555 Junk Street 99999 Beverly Hills CA 1 39.1500 -75.532 ZIP 115 E. Water St 19901 Dover 2 39.0953 -75.570 ZIP 760 Moose Lodge Road 19934 Camden 3 39.7366 -75.549 ZIP 200 S. Madison Str 19801 Wilmington DE 4 39.7317 -75.669 ZIP 4701 Limestone Road 19808 Wilmington 5 39.7877 -75.961 ZIP 2117 N 4th St 19363 Oxford PA 6 . . None 1313 Mockingbird Lane . Delray CC 7 38.7265 -75.081 ZIP 133 Silver Lake Dr 19971 Rehoboth Beach DE 8 38.9035 -75.432 ZIP 11 SE Front Street 19963 Milford DE 9 38.6387 -75.611 City 402 Nylon Boulevard . Seaford DE 10 39.2912 -75.606 City 363 E Commerce St . Smyrna DE 11 38.4663 -75.150 ZIP 5595 Polly Branch Rd 19975 Selbyville DE 12 38.4593 -75.053 ZIP 1209 Coastal Highway 19944 Fenwick Island DE 13 39.1509 -75.693 ZIP 2899 Arthursville Rd 19953 Hartly DE 14 . . None 41 Bramhall St . 15 38.4557 -75.574 City 9320 Old Racetrack Rd . Delmar DE 16 39.2282 -75.666 ZIP 281 W Commerce Str 19955 Kenton 17 39.6264 -75.850 ZIP 211 Blue Ball Road 21921 Elkton MD 18 39.0695 -75.567 ZIP 3893 Turkey Point Rd 19980 Woodside DE 19
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.