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 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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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