Hi I have a variable call splr_name which is a character variable and has alphanumeric values as shown in the picture and I need to extract only the numeric value and store it in a new variable called splr_number.
Attached the picture for reference.
I tried to use
Compress(splr_name,'kd');
But I got the output as blank.
Can anyone help me on this
Compress(splr_name,'kd');
should be
splr_name=compress(splr_name,,'kd');
note the two consecutive commas
Compress(splr_name,'kd');
should be
splr_name=compress(splr_name,,'kd');
note the two consecutive commas
Maxim 1: Read the Documentation: COMPRESS Function
Syntax
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 save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.