Data visualization with SAS programming

Creating a map of 2 variables from the same dataset

Reply
Contributor
Posts: 24

Creating a map of 2 variables from the same dataset

[ Edited ]

Hi, I have SAS9.1.

I am trying to create a university-country map from a dataset.

I tried :

proc gmap data = have map=maps.new;
id university;
choro country;
run;
quit;

 

gives me the error:

 

167 proc gmap data = data = have map=maps.new;
ERROR: Libname MAPS is not assigned.
168 id university;
169 choro country;
NOTE: The previous statement has been deleted.
170 run;

 

I need to dedupe the new dataset into the university column. NOt sure if gmap is not valid.

 

Any help will be appreciated.

Super User
Posts: 19,869

Re: Creating a map of 2 variables from the same dataset

Posted in reply to Antaralib

1. Check if you have SAS/GRAPH licensed, if you can run GCHART procs you do. Otherwise run the code below and make sure SAS/GRAPH shows up in the list. 

proc setinit; run;

2. For PROC GMAP data points to the data set that has the data that you want to graph. MAP= refers to the data that has the mapping data. Check your default SAS library and see what the maps library is called and which dataset has the US boundaries that you want. Your log is saying that maps doesn't exist, but I'm fairly certain it's been around, even in SAS 9.1. Take a look at your library, it may be called mapssas or maps or something along those lines. 

 

2b. Did you create a library called maps and import a SHP file you called NEW to the library? That's what your code is implying.

 

3. Why are you using SAS 9.1 -> upgrades are included in your license. If because your work hasn't updated, let them know it's more than 15 years old. If it's because you're using an illegal copy, and assuming you're only using it for learning purposes consider using SAS University Edition which is free, and then you can use GTL with polygon plots to make maps. 

SAS Employee
Posts: 170

Re: Creating a map of 2 variables from the same dataset

The error seems to indicate that Proc GMAP is there but the MAPS library is not.

I would suspect that you do not have the MAPS Library loaded on your system or you have defined MAPS to a location that does not exist.  There is not a "new" data set in the official MAPS library.

 

 

Contributor
Posts: 24

Re: Creating a map of 2 variables from the same dataset

Posted in reply to Darrell_sas

@Darrell_sas

Indeed there is no maps library.

Super User
Posts: 19,869

Re: Creating a map of 2 variables from the same dataset

Posted in reply to Antaralib

It may be installed but not assigned. See where your SASHELP folder resides and if it's there.  

 

If you had a valid SAS 9.3+ license you could download them from the web. 

 

Are you sure you're on SAS 9.1? 

SAS Employee
Posts: 170

Re: Creating a map of 2 variables from the same dataset

It used to be that the installer had a choice of installing MAPS or not.  And I think it was at 9.1 and before.  So it is possible that the person installing decided not to. 

Ask a Question
Discussion stats
  • 5 replies
  • 396 views
  • 2 likes
  • 3 in conversation