BookmarkSubscribeRSS Feed
marleeakerson
Calcite | Level 5

Is it possible to add longitude and latitude to a sas table if we have the address and zipcode? 

 

Trying to make a map in Tableau (which needs long and lat as opposed to just street address) but first I need to make the dataset in SAS. 

 

Thank you! 

4 REPLIES 4
ballardw
Super User

@marleeakerson wrote:

Is it possible to add longitude and latitude to a sas table if we have the address and zipcode? 

 

Trying to make a map in Tableau (which needs long and lat as opposed to just street address) but first I need to make the dataset in SAS. 

 

Thank you! 


Search for GEOCODING

Possible but depending on your assets it may not be "easy".

SAS provides a Proc Geocode that is part of SAS/Graph. If you have access to this procedure there is an example in the documentation of street level geocoding of addresses using some SAS supplied TIGER street data. Caution: you may need to update that file from the SAS website as streets are constantly added and the version supplied with your SAS install may be out of date.

 

If you don't have SAS/Graph (or Proc Geocode and the associated SASHELP library data sets) you may have to decide how much $$$ is available for either adding licenses or other options.

 

How many addresses do you need to geocode? There may be some options for doing small numbers free using other tools.

Reeza
Super User

You need a license for SAS/GRAPH but yes it can.

 

You can check what you have licensed in SAS using:
proc setinit; run;
And what's installed on your system using:
proc product_status; run;
The output will be in the log. 

marleeakerson
Calcite | Level 5

I have a license for SAS/GRAPH to use proc geocode. Do you have an example of code I could use a reference for turning street address into lat/long? 

Reeza
Super User

This paper has a detailed overview

http://support.sas.com/resources/papers/proceedings10/332-2010.pdf

 

And the documentation has a fully worked example available here:

https://documentation.sas.com/?docsetId=grmapref&docsetVersion=9.4&docsetTarget=p1o71xg9evwp20n17x3n...

 

FYI I have found that you do need to do some cleaning and standardization of your data ahead of time to get really good results. 

If you have access to SAS Data Quality Studio it does a decent job of cleaning up addresses and then geocoding them. 

 

 

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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