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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.