SAS decimal places

Reply
Regular Contributor
Posts: 150

SAS decimal places

I have an excel dataset, when I read the data in SAS it is adding extra decimal places, the values all have two in excel, example:

21.71

24.63

...

When SAS reads the values in they have like 10 decimal places, so:

21.71342342349

etc..

Why is SAS doing this and how do I get it to stop?

Thanks for your help!

Respected Advisor
Posts: 4,173

Re: SAS decimal places

Posted in reply to rfarmenta

Is the data in Excel formatted and the actual value is 21.71342342349 in Excel as well? Try and use another format with more decimals for this Excel cell and see what you get.

Regular Contributor
Posts: 150

Re: SAS decimal places

I tried that and it doesn't work, it is really weird. I've tried a few things and nothing seems to work...

Respected Advisor
Posts: 4,173

Re: SAS decimal places

Posted in reply to rfarmenta

So you say when you click into the cell in Excel you see the number in the formula bar also with 2 decimals only?

Can you attach your Excel (or better a copy of it with only one sheet and a few lines of data having this issue)?

Trusted Advisor
Posts: 1,137

Re: SAS decimal places

Posted in reply to rfarmenta

you can control the decimal place with the help of formats, please try

format var_name 8.2;

this will control the decimal places

Thanks,

jagadish

Thanks,
Jag
Ask a Question
Discussion stats
  • 4 replies
  • 521 views
  • 1 like
  • 3 in conversation