The sample code on the Full Code tab uses the MAPS.US map data set with PROC GREMOVE to produce a new map data set containing boundaries for the U.S. Bureau of the Census divisions.
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.
The graphics output in the Results tab was produced using SAS® 9.2. Submitting the sample code with releases of SAS prior to SAS 9.2 might produce different results.
/* Define the libref of MAPS if necessary */
*libname maps 'location-of-map-datasets';
/* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;
/* Create the sample data set CBSTATES */
data cbstates;
length State 8 Stcode $ 2 Division 4;
input Stcode Division;
State=stfips(stcode);
drop stcode;
datalines;
CT 1
MA 1
ME 1
NH 1
RI 1
VT 1
PA 2
NJ 2
NY 2
IL 3
IN 3
MI 3
OH 3
WI 3
IA 4
KS 4
MN 4
MO 4
ND 4
NE 4
SD 4
DC 5
DE 5
FL 5
GA 5
MD 5
NC 5
SC 5
VA 5
WV 5
AL 6
KY 6
MS 6
TN 6
AR 7
LA 7
OK 7
TX 7
AZ 8
CO 8
ID 8
MT 8
NM 8
NV 8
UT 8
WY 8
AK 9
CA 9
HI 9
OR 9
WA 9
;
run;
/* Sort data set in FIPS-code order */
proc sort data=cbstates out=cbsort;
by state;
run;
/* Merge DIVISION variable into map data set */
data uscb;
merge cbsort maps.us;
by state;
run;
/* Sort data set in DIVISION order */
proc sort data=uscb out=divstate;
by division;
run;
/* Remove interior boundaries within divisions */
proc gremove data=divstate out=remstate;
by division;
id state;
run;
/* Add a title to the map */
title1 'U.S. State Map (before GREMOVE)';
/* Define pattern characteristics */
pattern value=mempty repeat=48 color=black;
/* Show the original map */
proc gmap map=maps.us data=maps.us all;
id state;
choro state / nolegend;
run;
quit;
/* Define a new title for the map */
title1 'U.S. Census Division Map (after GREMOVE)';
/* Show the regional map */
proc gmap map=remstate data=remstate all;
id division;
choro division / nolegend;
run;
quit;
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: | Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Maps ==> Removing SAS Reference ==> Procedures ==> GMAP |
Date Modified: | 2005-09-22 03:03:12 |
Date Created: | 2005-05-23 14:17:39 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | SAS/GRAPH | z/OS | 9 TS M0 | |
64-bit Enabled AIX | 9 TS M0 | |||
Microsoft Windows XP Professional | 9 TS M0 | |||
Microsoft Windows Server 2003 Standard Edition | 9 TS M0 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9 TS M0 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9 TS M0 | |||
Microsoft Windows NT Workstation | 9 TS M0 | |||
Tru64 UNIX | 9 TS M0 | |||
OpenVMS Alpha | 9 TS M0 | |||
Linux | 9 TS M0 | |||
64-bit Enabled HP-UX | 9 TS M0 | |||
64-bit Enabled Solaris | 9 TS M0 | |||
HP-UX IPF | 9 TS M0 | |||
Microsoft Windows 2000 Professional | 9 TS M0 | |||
Microsoft Windows 2000 Server | 9 TS M0 | |||
Microsoft Windows 2000 Datacenter Server | 9 TS M0 | |||
Microsoft Windows 2000 Advanced Server | 9 TS M0 | |||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9 TS M0 | |||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9 TS M0 | |||
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9 TS M0 |