BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JayS
Obsidian | Level 7

I have a dataset that needs cleaning.
I have a field with A,B,C,D..... intermingled with 1,2,3,4....

Example: IA1234576BBX

These are invalid rows for the data, as only 1,2,3,4.... should be the value.

What is the best function to delete these rows.

Best would be to flag them so I can set a flag identifying them as invalid.

SAS EG 7.1.5

TIA Jay

1 ACCEPTED SOLUTION

Accepted Solutions
s_lassen
Meteorite | Level 14

I would suggest using the FINDC function to check if there are any alphabetic characters in the field. e.g.:

error_flag=findc(testvar,,'A')>0;

View solution in original post

2 REPLIES 2
s_lassen
Meteorite | Level 14

I would suggest using the FINDC function to check if there are any alphabetic characters in the field. e.g.:

error_flag=findc(testvar,,'A')>0;
JayS
Obsidian | Level 7

Thank you, nice to have that error_flag for future processing...

Thanks again... J

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 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
  • 2 replies
  • 601 views
  • 0 likes
  • 2 in conversation