Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- SAS decimal places

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

11-07-2013 11:59 PM

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!

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to rfarmenta

11-08-2013 12:41 AM

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Patrick

11-08-2013 01:03 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to rfarmenta

11-08-2013 01:09 AM

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)?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to rfarmenta

11-08-2013 02:37 AM

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

Jag