Desktop productivity for business analysts and programmers

SAS format Issue

Reply
New Contributor
Posts: 2

SAS format Issue

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;

Community Manager
Posts: 3,344

Re: SAS format Issue

Posted in reply to sumanthjbhargav

How about this:

proc sql;

create table temp as

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

quit;

Chris

Super User
Posts: 12,996

Re: SAS format Issue

Posted in reply to sumanthjbhargav

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.

Trusted Advisor
Posts: 1,270

Re: SAS format Issue

Posted in reply to sumanthjbhargav

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

New Contributor
Posts: 2

Re: SAS format Issue

Posted in reply to sumanthjbhargav

Many thanks for the conclusion

Trusted Advisor
Posts: 3,215

Re: SAS format Issue

Posted in reply to sumanthjbhargav

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 --<-----
Ask a Question
Discussion stats
  • 5 replies
  • 304 views
  • 2 likes
  • 5 in conversation