Sample 25587: Reducing the map of Canada using PROC GREDUCE
This sample is from the "SAS/GRAPH Software: Reference, Version 8", Volume 2, Chapter 24.
For additional information on the sample refer to this book.
/*+-------------------------------------------------------------+
| S A S S A M P L E L I B R A R Y |
| |
| NAME: GRDCANAD |
| TITLE: GRDCANAD-Reducing the Map of Canada |
| PRODUCT: GRAPH |
| SYSTEM: ALL |
| KEYS: GRAPHICS GOPTIONS GMAP GREDUCE MAPS PATTERN |
| PROCS: GMAP GREDUCE |
| DATA: EXTERNAL |
| |
| SUPPORT: GRAPHICS STAFF UPDATE: |
| REF: SAS/GRAPH REFERENCE GUIDE |
| MISC: EDIT AND UNCOMMENT THE LIBNAME STATEMENTS |
| IF THE LIBREFS HAVE NOT BEEN DEFINED. |
+-------------------------------------------------------------+*/
/* Define the libref maps */
*libname maps 'SAS-MAPS-library';
/* Set the graphics environment */
goptions reset=all gunit=pct border cback=white
colors=(black blue green red)
ftext=swiss htitle=6 htext=3;
/* Define the titles and footnotes for the first map */
title1 'Canada';
title2 h=4 'Using all DENSITY values';
footnote1 j=l ' From SAS/GRAPH' '02'x ' Software CANADA2 Data Set';
footnote2 j=r 'GRDCANAD(a) ';
/* Define pattern characteristics */
pattern value=mempty repeat=12 color=blue;
/* Show the unreduced map */
proc gmap map=maps.canada2 data=maps.canada2 all;
id province;
choro province / nolegend;
run;
/* Create the map data set CAN2 using */
/* the GREDUCE procedure */
proc greduce data=maps.canada2 out=can2;
id province;
run;
/* Define new title and footnote for the second map */
title2 h=4 'Using only DENSITY values 0 to 2';
footnote2 j=r 'GRDCANAD(b) ';
/* Show reduced map with density levels 0-2 */
proc gmap map=can2(where=(density<3)) data=can2
all;
id province;
choro province / nolegend;
run;
quit;

In this example, the GREDUCE procedure creates the DENSITY variable for the CANADA2 map data set that is provided with SAS/GRAPH . First, the map is displayed at its original density by using the GMAP procedure. Second, the map is displayed by using density values of 0 to 2.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GREDUCE SAS Reference ==> Procedures ==> GMAP Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Maps
|
| Date Modified: | 2005-09-22 03:03:12 |
| Date Created: | 2005-05-23 14:17:20 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |