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
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.
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.