Hi i want to get only numeric values where this is the input
data have;
length var1 $30.;
var1='hdhdxha82873jdjsd';output;
var1= 9293293991 ;output;
var1='123431hud';output;
var1=1223444;output;
run;
and the required output is
var1
9293293991
1223444
How can I extract just the numeric values. thanks
data want; set have; if lengthn(compress(var1,"","d"))=0 then output; run;
data want; set have; if lengthn(compress(var1,"","d"))=0 then output; run;
but what if that var1 has decimal value like this var1= 929329.3991 ;output; will it be able to get the output
data want; set have; if lengthn(compress(var1,".","d"))=0 then output; run;
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 lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.