Desktop productivity for business analysts and programmers

Reading Excel file with large decimal Places

Posts: 30

Reading Excel file with large decimal Places

Hi All , 


  I am trying to read an excel file into SAS with character variables having more than 10 decimal places and some of the cells has exponential values like 4.658535495689E-2, but after the excel is read i can see the decimal values in dataset only till 6 or 7th position only, but i want the complete decimal value to be displayed in the SAS dataset.There is no issue with the Length also, as some of the values are getting read completely ,but not all. Any options/methods to read the complete decimal values. Tried with inflie , libname statement also but could not retrieve all the decimal values from excel.

Some of the values present in excel are as below.





Below is the sample code used to retrieved.

proc import datafile="&path/&fname.xlsx"
dbms = xlsx out= data_ replace;
getnames = yes;


Any suggestions how to retrieve the complete decimal values from excel to SAS dataset.

Super User
Posts: 10,574

Re: Reading Excel file with large decimal Places

Be aware that SAS works with 8-byte real numbers, which means that the precision is restricted to around 15 decimal digits.


Assign a long enough format like best32. so you can see all digits present in SAS.

Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Posts: 13,941

Re: Reading Excel file with large decimal Places

Run Proc Contents on the resulting data set to see the format. Likely  it will be BEST8. The values are likely therr, barring more than 15 decimals just not displaying. If you really care to see that many decimals change the formats to something you preferr like BEST32. of F24.16 or such.

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation