Architecting, installing and maintaining your SAS environment

How to extract numbers

Accepted Solution Solved
Reply
Contributor
Posts: 71
Accepted Solution

How to extract numbers

HI All,

  I have a column which consists of numeric's and some numeric+char mixed.

  I'm sorry.I'm  looking only for numbers which are available in that column

ex

12345678

ab2345678d

45678ed34

34567289

looking for output:

12345678

34567289

I looking to get only numeric characters in that column. Can you help me

sas.9.2(base)

Regards,

venky


Accepted Solutions
Solution
‎08-21-2013 02:57 AM
Super User
Posts: 5,257

Re: How to extract numbers

Did you edit your post?

The conversation will make more sense if you post clarifications separately...

So, you might want to look to use the anyalpha() function instead.

Data never sleeps

View solution in original post


All Replies
Super User
Posts: 5,257

Re: How to extract numbers

Maybe there is cleaner way, but this quite straightforward:

numvar=input(compress(upcase(charvar),'ABC......XYZ'),best.);

Data never sleeps
Solution
‎08-21-2013 02:57 AM
Super User
Posts: 5,257

Re: How to extract numbers

Did you edit your post?

The conversation will make more sense if you post clarifications separately...

So, you might want to look to use the anyalpha() function instead.

Data never sleeps
Contributor
Posts: 71

Re: How to extract numbers

HI All,

  I have a column which consists of numeric's and some numeric+char mixed.

  I'm sorry.I'm  looking only for numbers which are available in that column

ex

12345678

ab2345678d

45678ed34

34567289

looking for output:

12345678

34567289

I looking to get only numeric characters in that column. Can you help me in the function.

I'm sorry i edited it.

sas.9.2(base)

Regards,

venky

Contributor
Posts: 71

Re: How to extract numbers

Thank you issue is resolved.

Regards

vnky

☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 340 views
  • 0 likes
  • 2 in conversation