BookmarkSubscribeRSS Feed
rfarmenta
Obsidian | Level 7

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!

4 REPLIES 4
Patrick
Opal | Level 21

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.

rfarmenta
Obsidian | Level 7

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

Patrick
Opal | Level 21

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

Jagadishkatam
Amethyst | Level 16

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 1577 views
  • 1 like
  • 3 in conversation