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
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.