Help using Base SAS procedures

Importing from Excel - decimal issues

Reply
Occasional Contributor
Posts: 12

Importing from Excel - decimal issues

Hi,

I'm using PROC IMPORT to bring an Excel file into SAS. The Excel file is formatted to only display 2 decimals, however, the actual number goes out to 16 decimal places. When I import this file into SAS, it'll only bring in the number with two decimal places. Is there any way to read in all the decimal places, without having to change the Excel file to display all the numbers?

Thanks for any help you can provide!

Respected Advisor
Posts: 3,156

Re: Importing from Excel - decimal issues

Somehow I couldn't repeat your problem.  I am running SAS 9.2 on XP pro box.

Haikuo

Occasional Contributor
Posts: 12

Re: Importing from Excel - decimal issues

hmm...interesting. I tried it with another file and it's working correctly. I'll have to look into this specific Excel file to see why it's not reading in correctly.

Thank you for looking into it.

Occasional Contributor
Posts: 12

Re: Importing from Excel - decimal issues

For those who encounter this issue in the future, if the variable is formatted as currency in Excel, then SAS will only read in that variable to 2 decimal places, even if the decimal place goes out further. The only solution I see is to format the variable as a general number in Excel. Any other suggestions are welcome!

Ask a Question
Discussion stats
  • 3 replies
  • 1891 views
  • 3 likes
  • 2 in conversation