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

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

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

2 REPLIES 2
ballardw
Super User

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.

jerry898969
Pyrite | Level 9

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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