Help using Base SAS procedures

Proc Geocode with FIPS info

Accepted Solution Solved
Reply
Super Contributor
Posts: 398
Accepted Solution

Proc Geocode with FIPS info

Hello,

I'm trying to see if I can geocode an address file and get back Fips State, Fips County, Tract, Block, Place, MSA, CBSA, etc.

The code below only returns Y, X, Block, Tract, M_ADDR, M_CITY, M_STATE, M_ZIP, M_OBS, _MATCHED_, _STATUS_, _NOTES_, _SCORE_ and then my columns, ID, RAW_ADDRESS, RAW_CITY, RAW_STATE, RAW_ZIP.  I'm not sure how to get the FIPS variables, Place, MSA, CBSA.

proc geocode

method = street

addressvar = RAW_ADDR

addresscityvar = RAW_CITY

addresszipvar = RAW_ZIP

addressstatevar = RAW_ST

data = temp

out = temp_out

attribute_var = (BLOCK, TRACT)

lookupstreet = geodata.USM

;

run ;

Thank you


Accepted Solutions
Solution
‎05-22-2015 05:08 PM
Super User
Posts: 10,460

Re: Proc Geocode with FIPS info

I'm not sure which interpretation of "place" you are using.

You can join your data with SASHELP.ZIPCODE to get state FIP, County FIP and MSA.

proc sql;

     create table want as

     select a.*, b.state, b.county, b.msa

     from have as a left join SASHELP.ZIPCODE as b

     on a.zipcode=b.zip;

quit;

Note that the Zip in SASHELP.ZIPCODE is numeric. There are a few city name variables that might correspond to your place.

You may need to find another dataset with CBSA to perform a similar merge.

View solution in original post


All Replies
Solution
‎05-22-2015 05:08 PM
Super User
Posts: 10,460

Re: Proc Geocode with FIPS info

I'm not sure which interpretation of "place" you are using.

You can join your data with SASHELP.ZIPCODE to get state FIP, County FIP and MSA.

proc sql;

     create table want as

     select a.*, b.state, b.county, b.msa

     from have as a left join SASHELP.ZIPCODE as b

     on a.zipcode=b.zip;

quit;

Note that the Zip in SASHELP.ZIPCODE is numeric. There are a few city name variables that might correspond to your place.

You may need to find another dataset with CBSA to perform a similar merge.

Super Contributor
Posts: 398

Re: Proc Geocode with FIPS info

Hi ballardw,

Thank you so much for you help.  That did get me those 3 variables I needed.  The place is the FIPS Place and the CBSA are the other 2 I need.  I will look to see if SAS offers a file that will contain those 2 variables.

Thank you again for your help.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 374 views
  • 0 likes
  • 2 in conversation