Help using Base SAS procedures

Export to Excel

Reply
Occasional Contributor
Posts: 10

Export to Excel

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!
Trusted Advisor
Posts: 2,113

Re: Export to Excel

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
Occasional Contributor
Posts: 10

Re: Export to Excel

Thank you for this information, Duke!
Ask a Question
Discussion stats
  • 2 replies
  • 139 views
  • 0 likes
  • 2 in conversation