EXAMPLE 8  Determine Customers Within Map Borders

Purpose: Demonstrate how to use the new SAS/GRAPH PROC GINSIDE to determine whether customers are in a sales area composed of a group of counties.

To make this example easy for you to run, and so you do not have to worry about having a customer database with hundreds of customer locations, I create some fake customer data from the sashelp.zipcode data set that is shipped with SAS:

proc sql;
 create table customers as
 select unique city, statecode as state, zip
 from sashelp.zipcode
 where statecode='NC';
quit; run;

I then use PROC GEOCODE (new in SAS 9.2) and look up the latitude and longitude of the ZIP code centroid for each customer. If you have the street address of your customer, you ...

Get SAS/GRAPH: Beyond the Basics now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.