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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

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
  • 2 replies
  • 732 views
  • 0 likes
  • 2 in conversation