SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
vvferreira
Calcite | Level 5

Hello Guys,

is there currently any function that can validate the phone number, mobile? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

A quick google search shows a lot of variation in this topic. 

 

Please provide some sample input data and expected output to demonstrate your problem. As you can see from the posts above there can be many variations in the source data and we're obviously unfamiliar with your data.

View solution in original post

6 REPLIES 6
Reeza
Super User
Validate as in check that the format is correct, or validate as in check that it's an operational phone number?
vvferreira
Calcite | Level 5

Hi, @Reeza
I would just like to validate if format is correct.

Reeza
Super User

A quick google search shows a lot of variation in this topic. 

 

Please provide some sample input data and expected output to demonstrate your problem. As you can see from the posts above there can be many variations in the source data and we're obviously unfamiliar with your data.

vvferreira
Calcite | Level 5

Thanks Reeza,

I'm a new member and I'm still getting used to it here 🙂

ballardw
Super User

Be aware that just a string of digits is insufficient. You need the spaces, dashes or whatever to separate out parts like, in US, Area-code and number.

Found this out with a set of "phone numbers" that had no spaces that included foreign country codes. Treated as US numbers and was dialing Colorado instead of Brazil.

LillyBates
Fluorite | Level 6

It’s true that without seeing some sample input and expected output, it’s tricky to give advice. There are so many variations in data formatting that can make a big difference in how it’s processed. When I was working on a form validation project that needed phone numbers for verification, using real examples helped figure out where things got stuck. We used Tardigrada for quick verification checks to make sure inputs were actually functional numbers. If you share a couple of sample rows of your data, it’ll make it easier to spot patterns and suggest fixes that match what you're trying to do.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 6 replies
  • 1422 views
  • 3 likes
  • 4 in conversation