Hi,
I am trying to take the sum ofa numerical variable but getting the values in exponential. I must retain the sum as whole number as it is because i need it for comparing.
data abc;
x = 9823748762398720570234;
run;
proc sql;
create table temp as
select sum(x) from abc;
quit;
How about this:
proc sql;
create table temp as
select sum(x) as Sum format=32. from abc;
quit;
Chris
If your example is typical of your data then you are exceeding the precision of SAS variables, at least as documented in SAS 9.3.
The precision of floating-point values is accurate to approximately 15 digits.
http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#numvar.htm
Many thanks for the conclusion
reading some old statistical books. make you data numbers to a converted offset position (1970's), sliders were seen, doing handwork understanding your data and tools.
The pitfall of working with big numbers is losing accuracy not notified.
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.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.