BookmarkSubscribeRSS Feed
louise
Calcite | Level 5
Hi,

Would like to ask how the export to Excel functionality in SAS Base works? I have a table that contains a numeric field with NLNUM25.2 format and was populated by a DI job. I tried exporting this table to Excel using the Export function in the File menu of SAS Base. When I opened the Excel file, the value was 0.94000000000002328, however, in the dataset it's corresponding value is 0.94. The strange part is, when the query was done in SAS Base using the same condition and format, the output it produced when exported to Excel was 0.939999999999497.

Howcome the two values produced different output in Excel, considering that they have the same formatted value, which is 0.94 in their respective datasets?

Thanks in advance!
2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12
The underlying reason is that data are stored in binary and the displayed version is a decimal approximation of the data. SAS can represent integers (within a certain size) exactly, but not decimal numbers. There is a lot of information on what is done in the SAS documentation. Search on . One in particular
http://support.sas.com/techsup/technote/ts230.html
might help.

Doc Muhlbaier
Duke
louise
Calcite | Level 5
Thank you for this information, Duke!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 875 views
  • 0 likes
  • 2 in conversation