Is there a lookup table for Canadian cities (eg: Vancouver, Calgary, Winnipeg) that is similar to the country lookup below:
http://support.sas.com/rnd/datavisualization/va63geo/subdivs.html
Thanks.
Take a look at this thread:
There is a SAS macro script attached to the 11th post on that thread that uses Google APIs to geocode. The script itself is pretty arcane but some users on that thread apparently had success with it.
On the other hand, since you only need cities (as opposed to street addresses), you might want to search for a city coordinates table (for example, here https://www.maxmind.com/en/free-world-cities-database) and join these latitude and longitude variables into your data set.
Thanks,
Sam
Hi Don,
We might add an easier way to map cities in the future, but currently you will need to add the city coordinates to your data set and then define a geography using custom coordinates.
If you have VA 8.2, or if you have a SAS/GRAPH license, then you can use the GEOCODE procedure to add the city coordinates to your data.
You can find documentation for GEOCODE here:
In particular, Example 5 should be helpful.
If you don't have access to GEOCODE, it is possible to add coordinates to your data in other ways but it is less convenient.
Let us know if this helps.
Sam
Thanks. Unfortunately, I do not have a SAS/GRAPH licence. Would you be able to provide me with the alternate method.
Thanks
Take a look at this thread:
There is a SAS macro script attached to the 11th post on that thread that uses Google APIs to geocode. The script itself is pretty arcane but some users on that thread apparently had success with it.
On the other hand, since you only need cities (as opposed to street addresses), you might want to search for a city coordinates table (for example, here https://www.maxmind.com/en/free-world-cities-database) and join these latitude and longitude variables into your data set.
Thanks,
Sam
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 16. Read more here about why you should contribute and what is in it for you!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.