1
votes

Hopefully someone out there will have run into this before. I'm trying to use the street level geocoding capability of SAS' PROC GEOCODE, but I keep getting a cryptic error. I couldn't find anything on the net about it (although to be fair I only spent a half hour looking).

First, I'm using SAS Enterprise Guide (I've tried on both v4.2 and v4.3), although I still prefer to program as I find the point and click interface quite limiting. Maybe this right here is my problem?

Anyway I first get the lookup data sets from http://support.sas.com/rnd/datavisualization/mapsonline/html/geocode.html and follow the instructions in the readme. I also use the pre-written SAS program to import the CSV files. My input dataset contains just 4 variables: street address, city, state, and zip. I then run the following code:

libname josh 'C:\Users\Josh\Desktop\Geocode\SAS files';

proc geocode
   method=street
   data=SASUSER.Home_Policy_Address_Detail
   lookupstreet=josh.USM
   out=test;
run;

However I get this error:

ERROR: Variable NAMENC not found in JOSH.USM data set.

Nowhere in the readme or the import program is a variable named "NAMENC" ever mentioned. This is what has me stumped. Is it something wrong with the simple PROC GEOCODE program I wrote? Is it due to me using SAS EG (although I've yet to run into a base SAS procedure that hasn't worked on EG)? Or something else?

Any help/guidance would be much appreciated. Thanks in advance!

1
I can confirm it is not an EG issue. EG writes code for you and runs it through SAS on the server. Same SAS as if you did it yourself.DomPazz
Indeed. If you are writing SAS programs in EG, then the only issues you could run into are a few specific options EG sets by default (OPTION NOFMTERR and OPTION VALIDVARNAME=ANY).Joe
Can you confirm what version of SAS you are running? Not the EG version, that's unimportant.Joe
So the NAMENC variable is neither in SASUSER.Home_Policy_Address_Detail nor JOSH.USM? Check the imported CSV files.Alex A.

1 Answers

1
votes

Check your SAS version. You can use the 'Help' menu in DMS mode or submit this statement:

%put &sysvlong;

It looks like you are using SAS 9.3 but your lookup data JOSH.USM is the lookup data formatted for SAS 9.4.

PROC GEOCODE street lookup data comes in two slightly different formats, one for SAS 9.3 and another for 9.4. When you download the nationwide lookup data from the SAS MapsOnline geocoding page, make sure to download the version appropriate for your SAS release.