Chapter Contents |
Previous |
Next |
The GREMOVE Procedure |
Procedure features: |
| |||
Other features: |
| |||
Sample library member: | GR25N01 |
The STATE variable in the MAPS.US data set, containing numeric FIPS codes for each state, is used as the BY-variable to merge the REFLIB.CBSTATES and MAPS.US data sets. The MAPS.US Data Set shows the variables that are present in the data set before using the GREMOVE procedure:
MAPS.US Data Set OBS STATE SEGMENT X Y 1 1 1 0.16175 -0.10044 2 1 1 0.12305 -0.10415 3 1 1 0.12296 -0.10678 . . . 1524 56 1 -0.18757 0.15035 1525 56 1 -0.10158 0.13997 1526 56 1 -0.10398 0.11343 |
And Map before Removing Borders (GR25N01(a)) shows the map before processing:
Map before Removing Borders (GR25N01(a))
The REMSTATE Data Set shows the variables that are present in the data set after you use the GREMOVE procedure. Notice that the new map data set contains a new variable called DIVISION:
REMSTATE Data Set OBS X Y SEGMENT DIVISION 1 0.29825 0.17418 1 1 2 0.29814 0.17820 1 1 3 0.30206 0.18045 1 1 . . . 1082 -0.18715 -0.16010 8 9 1083 -0.18747 -0.15971 8 9 1084 -0.18747 -0.15951 8 9 |
Map after Removing Borders (GR25N01(a)) shows the new map after PROC GREMOVE has removed interior state boundaries.
Map after Removing Borders (GR25N01(a))
libname reflib 'SAS-data-library'; libname maps 'SAS-maps-library'; goptions reset=global gunit=pct border cback=white colors=(black blue green red) ftext=swiss htitle=6 htext=3; |
data reflib.cbstates; length state 8 stcode $ 2 division 4; input stcode division; state=stfips(stcode); drop stcode; datalines; CT 1 MA 1 ...more data lines... OR 9 WA 9 ; |
proc sort data=reflib.cbstates out=cbsort; by state; run; |
data uscb; merge cbsort maps.us; by state; run; |
proc sort data=uscb out=divstate; by division; run; |
proc gremove data=divstate out=remstate; by division; id state; run; |
title 'U.S. State Map'; footnote j=r 'GR25N01(a) '; |
pattern value=mempty repeat=48 color=blue; |
proc gmap map=maps.us data=maps.us all; id state; choro state / nolegend; run; |
title 'U.S. Census Division Map'; footnote j=r 'GR25N01(b) '; |
proc gmap map=remstate data=remstate all; id division; choro division / nolegend; run; quit; |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.