BookmarkSubscribeRSS Feed
Vergriffene
Calcite | Level 5

Hello, I wanted to label two cities in a country by using GMAP, however, with the code I wrote I could not get the right location. Could anyone help me to see what is wrong? Thank you.

I want to label Michalovce and Svidnik in Slovakia.

Codes:

goptions reset=global gunit=pct border cback=white
         colors=(black blue green red)
         ftext=swissb htitle=6 htext=3;
data mymap1;
set mapsgfk.SLOVAKIA;
keep x y;
run;
data MYMAP;
   merge mapsgfk.SLOVAKIA_attr mymap1;
   RUN;
data citystar;
   length function style color $ 8 position $ 1
          text $ 20;
   retain function 'label' xsys ysys '2' hsys '3'
          when 'a';
   set MYMAP(keep=x y IDNAME id1name);
   if (IDNAME="Michalovce" and id1name='Kosicky')
       or IDNAME="Svidnik";
   style='special'; text='M'; color='red'; size=7;
      position='5'; output;
   style='swissb'; text=IDNAME; color='green';
      size=5; position='8'; output;
run;
title "Investigated Areas in Slovakia";
pattern value=mempty color=blue repeat=49;
proc gmap data=MYMAP map=MYMAP;
   id id1name;
   choro id1name / annotate=citystar discrete nolegend;
run;
quit;

 

2 REPLIES 2
SAS_Cares
SAS Employee

You can find some tips for using the GMAP procedure in this white paper "The Basics of Map Creation with SAS/Graph" https://support.sas.com/resources/papers/proceedings/proceedings/sugi29/251-29.pdf

 

PaigeMiller
Diamond | Level 26

The PROC GMAP documentation has an example that does exactly what you want.

 

https://documentation.sas.com/?cdcId=pgmmvacdc&cdcVersion=9.4&docsetId=grmapref&docsetTarget=p1b2z0l...

--
Paige Miller

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 569 views
  • 0 likes
  • 3 in conversation