Sample 62261: Add markers at city locations for SAS offices on an Esri map
The sample code on the Full Code tab uses the SGMAP procedure to add markers on an Esri map at the city location of U.S. SAS offices, whose locations are determined by city geocoding with PROC GEOCODE.
You must be using the fifth maintenance release of SAS® 9.4 (TS1M5) on 64-bit Windows or 64-bit Linux operating systems in order to run this sample.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample uses the SGMAP procedure to add markers on an Esri map at the city location of U.S. SAS offices, whose locations are determined by city geocoding with PROC GEOCODE.
You must be using the fifth maintenance release of SAS® 9.4 (TS1M5) on 64-bit Windows or 64-bit Linux operating systems in order to run this sample.
/* Create a sample data set containing the names of
U.S. cities where a SAS office is located */
data sas_offices;
infile datalines dlm='#';
length city $ 24 state $ 2;
input city state;
datalines;
Irvine # CA
Sacramento # CA
San Diego # CA
San Francisco # CA
Ellicott City # MD
Rockville # MD
Cary # NC
Charlotte # NC
Boston # MA
Pittsburgh # PA
Southfield # MI
Austin # TX
Glastonbury # CT
Minneapolis # MN
Addison # TX
Tallahassee # FL
Bloomington # MN
Houston # TX
New York # NY
Arlington # VA
Chicago # IL
;
run;
/* Use CITY geocoding with PROC GEOCODE to determine
the coordinates for the cities */
proc geocode data=sas_offices out=office_locations method=city;
run;
/* Use the Office_locations data to place a marker on an Esri map */
title 'Locations of SAS offices in the U.S.';
proc sgmap plotdata=office_locations;
/* Reference the Esri map */
esrimap
url='http://services.arcgisonline.com/arcgis/rest/services/ESRI_StreetMap_World_2D';
scatter x=long y=lat / markerattrs=(color=red size=6px symbol=circlefilled);
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> SGMAP
|
Date Modified: | 2018-06-01 14:53:39 |
Date Created: | 2018-05-02 16:02:46 |
Operating System and Release Information
SAS System | Base SAS | Linux for x64 | 9.4 TS1M5 | |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M5 | |
Microsoft Windows 8.1 Pro x64 | 9.4 TS1M5 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M5 | |
Microsoft Windows 8 Pro x64 | 9.4 TS1M5 | |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M5 | |
Microsoft® Windows® for x64 | 9.4 TS1M5 | |