BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AmitKB
Fluorite | Level 6


Hi all,

           The street look up data provided by SAS for use with proc geocode is huge. I am only intersted in doing street geocoding for Missouri. Is their a way to subset that data.

   I appreciate your help.

Best Regards,

Amit

1 ACCEPTED SOLUTION

Accepted Solutions
EdO_sas
SAS Employee

I assume you are referring to the nationwide street lookup data containing all of the US states. It is possible to subset those data sets but there is not a SAS-supplied utility for doing so. You'd have to write it. Subsetting the USM data set for only Missouri is easy. However, if you'd want to remove non-Missouri observations from the associated USS data set, you'd have to redo the FIRST and LAST values in USM which are row number links into USS. Then to subset the USP data set, you'd also have to update the START row numbers in the USS data set. While possible, it would take a while to code and debug.

A more straightforward approach would be to download the TIGER data for Missouri and use the TIGER2GEOCODE.sas program from MapsOnline to import it. You will need the EDGES, FACES and FEATNAMES files for all of the counties in Missouri. On the Geocoding page (http://support.sas.com/rnd/datavisualization/mapsonline/html/geocode.html), download the TIGER2GEOCODE.zip file which includes that SAS program. Instructions are in the program comments at the top of the file. SAS Technical Support can provide assistance if needed. I hope this helps.

View solution in original post

2 REPLIES 2
EdO_sas
SAS Employee

I assume you are referring to the nationwide street lookup data containing all of the US states. It is possible to subset those data sets but there is not a SAS-supplied utility for doing so. You'd have to write it. Subsetting the USM data set for only Missouri is easy. However, if you'd want to remove non-Missouri observations from the associated USS data set, you'd have to redo the FIRST and LAST values in USM which are row number links into USS. Then to subset the USP data set, you'd also have to update the START row numbers in the USS data set. While possible, it would take a while to code and debug.

A more straightforward approach would be to download the TIGER data for Missouri and use the TIGER2GEOCODE.sas program from MapsOnline to import it. You will need the EDGES, FACES and FEATNAMES files for all of the counties in Missouri. On the Geocoding page (http://support.sas.com/rnd/datavisualization/mapsonline/html/geocode.html), download the TIGER2GEOCODE.zip file which includes that SAS program. Instructions are in the program comments at the top of the file. SAS Technical Support can provide assistance if needed. I hope this helps.

ballardw
Super User

I'm not familiar with the structure of that data but generally any place you reference a dataset you can use the WHERE dataset option to only include data of interest.

It would look something like:

lookup= geocodedatasetname (where=(State='MO'))   if state were to use the 2 letter abbreviation.

The name of the variables in the where option are from your data.

If you are only doing a few cities it possibly could look like:

(where = (State='MO' and city in ('City name 1', 'City name 2'...)   the case and spelling of the city name in this clause would have to match what is in the data.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2 replies
  • 1115 views
  • 0 likes
  • 3 in conversation