Maps Online >Resources SAS logo
Feedback   

Sample Data
Sample Programs
Tools
Useful Links

//*******************************************************************\
| Copyright (C) 2003 by SAS Institute Inc., Cary, NC, USA.          |
|                                                                   |
| SAS (R) is a registered trademark of SAS Institute Inc.           |
|                                                                   |
| SAS Institute does not assume responsibility for the accuracy of  |
| any material presented in this file.                              |
\*******************************************************************/

/* Showing your response data on a map */

/********************************************************************
* This SAS program is a simple example of how to display your      *
* response data on a map.                                        *
********************************************************************/

/********************************************************************
* change this "path to a location in your file system" to an       *
* actual path.   This is the only line you have to change to run   *
* the program. DO NOT USE QUOTES.                                 *
********************************************************************/

%let path=%str(path to a location in your file system);

/********************************************************************
* this step creates some sample data to be mapped.                 *
********************************************************************/

data nba03;
infile cards stopover;
input state 4. @9 stname & $25. @33 FG ;
datalines;
04      ARIZONA                  851
06      CALIFORNIA              2563
08      COLORADO                 319
11      DISTRICT OF COLUMBIA     700
12      FLORIDA                  484
13      GEORGIA                  990
17      ILLINOIS                 705
18      INDIANA                  350
22      LOUISIANA                724
25      MASSACHUSETTS            789
26      MICHIGAN                 331
27      MINNESOTA                421
34      NEW JERSEY               897
36      NEW YORK                 357
39      OHIO                     694
40      OKLAHOMA                 265
41      OREGON                   543
42      PENNSYLVANIA             776
47      TENNESSEE                308
48      TEXAS                   2162
49      UTAH                     701
53      WASHINGTON               724
55      WISCONSIN                893
;
run;

filename gsasfile "&path.usresp.gif";

/*************************************************************
* sets up some graphics options for this output.            *
*************************************************************/
goptions reset=pattern reset=all dev=gif
transparency gaccess=gsasfile
goutmode=replace xpixels=600 ypixels=400
ftext=simplex gunit=pct htext=.15in ctext=black;

/***********************************************************
* Set the title, footnote, graph pattern and color        *
* define how the legend should look.                      *
***********************************************************/
title 'NBA 2002-2003 Season points for top 50 players';
pattern v=s c=cxFFFF99  ;
legend1 label=('Field Goals');

/* create the map using the GMAP procedure. */
proc gmap data=nba03 map=MAPS.US all;
id state;
block fg / name="usresp" discrete
shape=cylinder
legend=legend1
coutline=black;
run;
quit;


/********************************************************************
* For more examples on showing your response data on a map.               *
********************************************************************/