BookmarkSubscribeRSS Feed
sp3
Calcite | Level 5 sp3
Calcite | Level 5

Hi,

 

SAS 9.4 TS Level 1M1

X64_7PRO platform

 

I am having some issues with Proc Geocode. I have followed all of the directions for downloading the correct data from SAS Maps Online - since I need data for Alberta Canada, I have downloaded the latest shape files from GeoBase National Road Network (NRN) files and created the required sas files using the Geobase2Geobase.sas macro.  Everything installed fine.

 

After preparing the data input file in the correct format and importing into SAS, I ran the procedure and it crashed on me while making reference to a missing group variable. I am uncertain why this error occurred since I have no variable named group in the data input file and there are none in any data sets that I can see. Any advice would be appreciated.

 

Here is the code:

 

proc geocode
method = street /* Street method */
data = geocode.fas_mif_location_ab /* Address data to geocode */
out = geocode.geo_fas_mif_location_ab /* Geocoded output data set */
lookupstreet = geocdeab.alberta_m /* Street lookup data set */
direct = geocdeab.gcdirect_can /* English/French directions */
type = geocdeab.gctype_can /* Canadian street types */
addressvar = address /* street address */
addresscountryvar = country /* Input data set country name var */
addressstatevar = province /* Input data set state name var */
addresscityvar = city /* Input data set city name var */
nozip; /* Disable ZIP method */
run;

 

Here is the error message:

 

NOTE: Lookup data set MAPSGFK.WORLD_CITIES used for worldwide geocoding.
ERROR: Variable GROUP not found in GEOCDEAB.GCTYPE_CAN data set.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set GEOCODE.GEO_FAS_MIF_LOCATION_AB may be incomplete. When this step was
stopped there were 0 observations and 0 variables.
WARNING: Data set GEOCODE.GEO_FAS_MIF_LOCATION_AB was not replaced because this step was stopped.
NOTE: PROCEDURE GEOCODE used (Total process time):
real time 0.43 seconds
cpu time 0.03 seconds

 

Thanks

3 REPLIES 3
Shmuel
Garnet | Level 18

You wrote "...created the required sas files using the Geobase2Geobase.sas macro.";

I guess, the problem is somwhere in the macro, while creating the file.

 

If you have another country that works fine, compare variable names of GCTYPE* datasets.

If you saved the log of dataset creation, check it for WARNING / ERROR messages, if any.

 

As I'm using the SAS University Edition, I have no acces to SAS GRAPH.

Darrell_sas
SAS Employee

We have a new version of CodeBase2Geocode.sas that should take care of this problem.

Please let us know if this fixes the import.

 

 

sp3
Calcite | Level 5 sp3
Calcite | Level 5

Thanks Darrell. I managed to get it working by importing another file that including the missing "Group" variable but I will definitely redo the data import using the new Geocode macro that you have provided. Once I have done so I will report on any progress.

Thanks,

sp3

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 833 views
  • 0 likes
  • 3 in conversation