BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Char
Obsidian | Level 7

It has been many years since I've used GMAP and I've never used the uscity data set.  I want to display a count of providers per city in a particular state.  I don't get errors and I can see the legend but the map does not appear.  I'm sure there is some basic thing I'm missing.  This is my code...

 

proc gmap data=PERFS

MAP=MAPS.uscity ALL;

WHERE STATECODE = 'CA';

ID STATE PLACE;

CHORO PERFS/COUTLINE=BLACK;

RUN;

QUIT;

 

My data set called perfs contains 5 variables.

 

City = name of the city

Statecode = 2 alphas for the state (e.g. CA for California)

perfs = number of perfs in the city

state = numeric fips code for state (e.g. 1 for Alabama) 

place = place variable merged in from maps.uscity based on state and city

 

Any direction is much appreciated.  If helpful, I'm using SAS v9.3 in the windows environment.  Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Maps.UScity is a feature data set. It does not contain state boundaries. So that may be part of the issue. The values (counts) associated with cities would be in an annotate data set.

 

On this page, http://robslink.com/SAS/democd44/aaaindex.htm , there is a link to Example 12. Cities that shows placing total values for a few cities on a US map.

View solution in original post

4 REPLIES 4
ChrisBrooks
Ammonite | Level 13

It's a bit difficult to be certain without seeing some data from PERFS but I suspect the problem might lie with your where clause - try this

 

proc gmap data=PERFS
MAP=MAPS.uscity(WHERE STATECODE = 'CA') ALL;
ID STATE PLACE;
CHORO PERFS/COUTLINE=BLACK;
RUN;
QUIT;
Char
Obsidian | Level 7

That didn't seem to do it.  Here is an example of what my data in perfs looks like...

 

sample.jpg

 

This is completely made up - the place values don't match anything in CA - at least I don't believe so. 

 

ballardw
Super User

Maps.UScity is a feature data set. It does not contain state boundaries. So that may be part of the issue. The values (counts) associated with cities would be in an annotate data set.

 

On this page, http://robslink.com/SAS/democd44/aaaindex.htm , there is a link to Example 12. Cities that shows placing total values for a few cities on a US map.

Char
Obsidian | Level 7

Ah - I did not know that.  Thanks, that is exactly what I was looking for!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1724 views
  • 0 likes
  • 3 in conversation