Help using Base SAS procedures

anyalpha function

Accepted Solution Solved
Reply
Super Contributor
Posts: 259
Accepted Solution

anyalpha function

My understanding is that this function returns a position of the first letter of the alphabet in a string. Is there a similar function that include all non-numeric symbols.

The code I'm using is if anyalpha(field1) eq 0 then field2 = field1;

else field2 = 0;

But I'm not sure what function I should use if there is "/", "-", etc.


Accepted Solutions
Solution
‎07-20-2015 08:15 AM
Super User
Posts: 9,687

Re: anyalpha function

Check  notdigit()   function .

View solution in original post


All Replies
Super Contributor
Posts: 259

Re: anyalpha function

I actually googled it there and the function for non-alphabetical characters is notalpha

Super Contributor
Posts: 259

Re: anyalpha function

actually that doesn't work. What I'm looking for is a function that returns the position of the first character in a string that is not a number.

Super User
Super User
Posts: 7,413

Re: anyalpha function

Have you tried:

position=findc(your_string,'_','a');

Note I just added _ to give it something to work with, the main part is the 'a' which adds all the alpha characters.

Solution
‎07-20-2015 08:15 AM
Super User
Posts: 9,687

Re: anyalpha function

Check  notdigit()   function .

☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 525 views
  • 0 likes
  • 3 in conversation