BookmarkSubscribeRSS Feed
gwcanalytics
Calcite | Level 5

Does anyone out there have code to share that will help me to extract numbers out of a character variable that may or may not have numbers embedded in the observation?

Specifically, I just need to extract the street number out of a variable that contains the street address but no guarantee where the street number is embedded in the string or how many digits there are.

Thanks, in advance, for any help!

4 REPLIES 4
data_null__
Jade | Level 19

Start with ANYDIGIT function and work from there.

gwcanalytics
Calcite | Level 5

Thank you!  This was very helpful to get me started.

Reeza
Super User

compress with kd option is also useful.

data_null__
Jade | Level 19

What will COMPRESS KD give for "123 West 23rd"?

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1911 views
  • 8 likes
  • 3 in conversation