Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

gmap partial maps of canada and usa

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 78
Accepted Solution

gmap partial maps of canada and usa

I wrote the following gmap input data  and got  an error for the canada part. 

/* Combine the map data set with the annotate data set. */
data all;
	/* Subset out the states that you do not want. */
	/* The FIPS code of 2 is Alaska, 15 is Hawaii, */

	/* and 72-Puerto Rico. California-6 Florida-12 
	Oregon-41 Nevada-32 Arizona-4*/
	set maps.states(where=(state not in(2 4 6 12 15 32 41 72))) 
		maps.canada(where=(province not in(10:13 60 61))) anno;
		*anno;

	*maps.canada4 anno;
	*maps.canada4(where=(province not in(10:13 60 61))) anno;
run;

The error message is: 

93 data all;
94 /* Subset out the states that you do not want. */
95 /* The FIPS code of 2 is Alaska, 15 is Hawaii, */
96
97 /* and 72-Puerto Rico. California-6 Florida-12
98 Oregon-41 Nevada-32 Arizona-4*/
99 set maps.states(where=(state not in(2 4 6 12 15 32 41 72)))
100 maps.canada(where=(province not in(10:13 60 61))) anno;
ERROR: WHERE clause operator requires compatible variables.

 

I would appreciate help in correcting this error.

 

Thanks. 


Accepted Solutions
Solution
‎12-18-2017 03:36 PM
Super User
Posts: 13,941

Re: gmap partial maps of canada and usa

In my Maps.canada dataset Province is character. You would have to use

 

maps.canada(where=(province not in('10' '11' '12' '13' '60' '61')

 

the value list '10':'13' does not work with character values because '101' would be "between" '10' and '13'. And because there are so many possible issues with inclusion for character SAS has just skipped that coding issue and doesn't allow it.

The error message

ERROR: WHERE clause operator requires compatible variables

means that you are comparing a text variable to numeric somewhere.

 

View solution in original post


All Replies
Solution
‎12-18-2017 03:36 PM
Super User
Posts: 13,941

Re: gmap partial maps of canada and usa

In my Maps.canada dataset Province is character. You would have to use

 

maps.canada(where=(province not in('10' '11' '12' '13' '60' '61')

 

the value list '10':'13' does not work with character values because '101' would be "between" '10' and '13'. And because there are so many possible issues with inclusion for character SAS has just skipped that coding issue and doesn't allow it.

The error message

ERROR: WHERE clause operator requires compatible variables

means that you are comparing a text variable to numeric somewhere.

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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