BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Annie_Fréchette
Obsidian | Level 7

Hi!

In my access table, my numeric variable has been entered manually by me and looks like, for example, 34.4. When I import it in SAS, the same variable become 34.400001526. The format is numeric BEST12. What is causing this?

 

Thanks,

Annie

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@Annie_Fréchette wrote:

Hi!

In my access table, my numeric variable has been entered manually by me and looks like, for example, 34.4. When I import it in SAS, the same variable become 34.400001526. The format is numeric BEST12. What is causing this?

 

Thanks,

Annie


This is a not uncommon issue with decimal values not being represented quite as desired by binary and possibly complicated by how the Access to SAS conversion was accomplished.

 

You can try to round your value in the SAS data set to one decimal. In a data step

 

data want;

    set have;

    var = round(var, 0.1);

run;

 

 

View solution in original post

2 REPLIES 2
ballardw
Super User

@Annie_Fréchette wrote:

Hi!

In my access table, my numeric variable has been entered manually by me and looks like, for example, 34.4. When I import it in SAS, the same variable become 34.400001526. The format is numeric BEST12. What is causing this?

 

Thanks,

Annie


This is a not uncommon issue with decimal values not being represented quite as desired by binary and possibly complicated by how the Access to SAS conversion was accomplished.

 

You can try to round your value in the SAS data set to one decimal. In a data step

 

data want;

    set have;

    var = round(var, 0.1);

run;

 

 

Annie_Fréchette
Obsidian | Level 7

Thks!  I will round it of course. I was wondering where all that precision suddenly came from...

 

Have a nice day!

Annie

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 377 views
  • 0 likes
  • 2 in conversation