BookmarkSubscribeRSS Feed
IIIEEE
Calcite | Level 5

I've created my maps using shape files of the UK at  a postcode area level. My proc map import data set has:

 

X      Y        Postcode-area

-2     56            AB

-2    52              B

-2    53             BB

 

My response variable is called response from the response_1 dataset

 

proc gmap map=Post code areas data=response_1;
id Postcode-area;
choro response / ;
run;
quit;

I'm trying to annotate each area with the appropriate postcode-area. 

 

All the examples I've come across use  %annomac; %centroid, however I can't get it to work for my maps.

 

Any help will be much appreciated.

Thanks

1 REPLY 1
GraphGuy
Meteorite | Level 14

Here's a simple example that shows the basics:

 

data my_map; set maps.us;
original_order+1;
run;

 

proc sort data=my_map out=my_map;
by statecode;
run;

 

%annomac;
%centroid(my_map, centers, statecode, segonly=1);

 

data centers; set centers;
xsys='2'; ysys='2'; hsys='3'; when='a';
length function $50;
function='label';
text=trim(left(statecode));
run;

 

pattern1 v=s c=cornsilk;

 

proc gmap data=my_map map=my_map anno=centers;
id statecode;
choro segment / levels=1 nolegend;
run;

 

gmap1.png

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 487 views
  • 0 likes
  • 2 in conversation