Features: |
BY statement ID statement |
Other features: |
SORT procedure, MERGE statement, and LIBNAME statement |
Sample library member: | GRMUSMAP |
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
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
goptions reset=all border;
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 PR 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 ;
proc sort data=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 "GRMUSMAP(a) ";
pattern value=mempty color=blue;
proc gmap map=maps.us data=maps.us all; id state; choro state / nolegend levels=1; run;
title "U.S. Census Division Map"; footnote j=r "GRMUSMAP(b) ";
proc gmap map=remstate data=remstate all; id division; choro division / nolegend levels=1; run; quit;
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 PR 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 ;