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

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 433 views
  • 0 likes
  • 3 in conversation