BookmarkSubscribeRSS Feed
harshpatel
Quartz | Level 8

Hi Folks,

I am trying to run below code

data person;
input name $ val;
datalines;
Mary 1236.52999991234
;

But after submitting the code, number is getting truncated after decimal places

I am getting only 1236.5299999 

Last four digits i.e. 1234 are not coming but i want to print the whole number as it is

Is there any way?

 

Thanks,

Harsh

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

1. What format do you use for this numeric variable? It looks like the number is fine, but it is displayed rounded.

2. Be aware that PC and Unix machines cannot store more than 15 (sometimes 16) exact digits.

3. This number has 15 digits, and is not altered:

data T;
  X= 1236.52999991234;
   put X= 32.16;
run;

X=1236.5299999123400000

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 767 views
  • 0 likes
  • 3 in conversation