Hi, I have percentage data but in character format. I'm using this code to transform it:
data monic.fondorfdol;
set work.fondorfdol;
tir1=input(tir,percent5.5);
run;
But I don't get the exact number, for example, these are original values:
5.8077%
1.7514%
After the transformation, I get:
5.807
1.751
It's not necessary the percetange symbol, but I want to have all decimal numbers, is it possible?
Thanks!
data monic.fondorfdol;
set work.fondorfdol;
tir1=input(tir,percent.);
run;
data monic.fondorfdol;
set work.fondorfdol;
tir1=input(tir,percent.);
run;
Thank you very much, I always thought that I have to specify the width of the value.
The number after the period in an informat isn't the number of decimal places. According to the documentation: the number specifies an optional decimal scaling factor in the numeric informats. SAS divides the input data by 10 to the power of d.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.