BookmarkSubscribeRSS Feed
amber7391
Fluorite | Level 6

Hi genius SAS people.

Can anyone help me with some truncate problem. I really appreciate it!

 

I have a dataset-->have as the following.

 

have 
idprobability
11.23
12.345
11
10.222
21
22
31.6678
40.8987
51.2345
50.4566
51.44888

 

Now, I want to multiply the probabilities and group by id. Also, I need to truncate the decimal places to 10 decimal places without rounding.

The following is how I want my result look like. Also, I would like to apply the truncate function to the whole column.

 

idprobabilitywant  
11.23*2.345*1*0.2220.6403257  
21*22  
31.66781.6678  
40.89870.8987  
51.2345*0.4566*1.448880.816694101576<--0.8166941015
2 REPLIES 2
Tom
Super User Tom
Super User
int(value*10**10)/10**10
Ksharp
Super User
proc format ;
picture fmt
 low-hight='9.0000000000';
run;
data x;
input x;
format x fmt20.10;
cards;
0.6403257	 	 
2	 	 
1.6678	 	 
0.8987	 	 
0.816694101576
;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2660 views
  • 0 likes
  • 3 in conversation