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