BookmarkSubscribeRSS Feed
jGaboardi
Fluorite | Level 6

Geocoding addresses is fairly straightforward thing to do with many programming languages and service, but most (if not all) require an internet connection. I work in a highly-secure research data center and what I am looking for is a geocoding option that can be performed without an internet connection. I haven't been able to find a definitive answer to this yet. Is this possible with PROC GEOCODE?

8 REPLIES 8
DanH_sas
SAS Super FREQ

Once you download the address data from maps online (http://support.sas.com/rnd/datavisualization/mapsonline/index.html), no internet connection is needed to use PROC GEOCODE.

jGaboardi
Fluorite | Level 6

Thanks for the prompt answer! Will the GEOCODE work with user proved datasets? (e.g. TIGER/Line shapefiles?) I will have no internet connection whatsoever and bringing external data into the data center where I do research is quite a process.

Reeza
Super User

GEOCODE takes address data, as text, not SHP files. 

 

The other G procedures, GINSIDE, GMAP and SGMAP will work with SHP files. Not sure about TIGER/Line as I've never worked with those. 

 

I ran a RDC type lab and it was fine with GEOCODE. Make sure you do download the supporting files required though ahead of time and verify the version of SAS, I find the labs are usually a few versions behind :(.

 


@jGaboardi wrote:

Thanks for the prompt answer! Will the GEOCODE work with user proved datasets? (e.g. TIGER/Line shapefiles?) I will have no internet connection whatsoever and bringing external data into the data center where I do research is quite a process.


 

 

GraphGuy
Meteorite | Level 14

Reeza mentioned "The other G procedures, GINSIDE, GMAP and SGMAP will work with SHP files."

 

That might need a little clarification. In order to use SHP files (Shapefiles) with these procedures, I believe you first have to use Proc Mapimport to import the Shapefiles into SAS datasets (I don't think these procedures can work with the Shapefiles directly). But this isn't important for your proc Geocode question. 🙂

 

 

ballardw
Super User

Proc Geocode will support custom look up data sets, the option on the Proc Geocode statement is LOOKUP= <dataset name>.

Please read the entire documentation for the Proc Geocode statement. There are nearly 20options used to tell which variables in the look up data set are used for which purpose. Note that you can also use a data set that contains IPv4 internet addresses for look up. The fun part is building the appropriate data.

 

It has been awhile since I looked but the US Census website actually used to have SAS code for using TIGER files.

jGaboardi
Fluorite | Level 6

The fun part is building the appropriate data.

 

The "fun" part. LOL. This has been the bane of my existence (and my bread and butter) for many years now.

Reeza
Super User

@jGaboardi wrote:

The fun part is building the appropriate data.

 

The "fun" part. LOL. This has been the bane of my existence (and my bread and butter) for many years now.


The 'fun' part is likely why we all have jobs 🙂

GraphGuy
Meteorite | Level 14

You don't need an Internet connection to run Proc Geocode ... but you do need "lookup data" dataset(s) that your SAS session can get to.

 

If city-level or zipcode-level geocoding is good enough for your purposes, then you can use the sashelp.zipcode dataset (which we ship with SAS) as your lookup dataset.  Below are 2 examples.

 

If you want to do street-level geocoding, for US addresses, then you'll need to download the (large) street-level lookup data that Dan pointed you to in a previous comment.

 

data my_data1;
city='Cary'; state='NC';
run;

proc geocode data=my_data1 out=my_data1 lookup=sashelp.zipcode method=CITY;
run;

proc print data=my_data1;
run;


data my_data2;
city='Cary'; state='NC'; zip=27513;
run;

proc geocode data=my_data2 out=my_data2 lookup=sashelp.zipcode method=ZIP;
run;

proc print data=my_data2;
run;

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 8 replies
  • 1428 views
  • 13 likes
  • 5 in conversation