BookmarkSubscribeRSS Feed
sumanthjbhargav
Calcite | Level 5

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;

5 REPLIES 5
ChrisHemedinger
Community Manager

How about this:

proc sql;

create table temp as

select sum(x) as Sum format=32.  from abc;

quit;

Chris

SAS Innovate 2025: Call for Content! Submit your proposals before Sept 25. Accepted presenters get amazing perks to attend the conference!
ballardw
Super User

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.

stat_sas
Ammonite | Level 13

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

sumanthjbhargav
Calcite | Level 5

Many thanks for the conclusion

jakarman
Barite | Level 11

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.  

---->-- ja karman --<-----

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1045 views
  • 2 likes
  • 5 in conversation