@animesh123 sure. Please mark my answer as the accepted solution if the code works for you.
The Compress Function keeps only digits from the string. 'kd' = 'keep digits'.
The Input Function converts the character string to numeric.
What numeric value do you want to extract?
Try this
data test;
string = 'a1b2c3df456';
newstring = input(compress(string, , 'kd'), 8.);
run;
@animesh123 sure. Please mark my answer as the accepted solution if the code works for you.
The Compress Function keeps only digits from the string. 'kd' = 'keep digits'.
The Input Function converts the character string to numeric.
What does _num_ mean here?
So you want to expand this logic to all numeric variables in your data step?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.