Slightly different since the request is to always round down.
data have; input value1 value2 value3; newval1=100* floor(value1/100); newval2=100* floor(value2/100); newval3=100* floor(value3/100);; cards; 111 1499 15251 ;
unfortunately the FLOOR and CEIL functions do not have the round off precision value parameter that ROUND does.
View solution in original post
if we use round as below we get
100 1500 15300
data have; input value1 value2 value3; newval1=round(value1,100); newval2=round(value2,100); newval3=round(value3,100); cards; 111 1499 15251 ;
No. Here are two algorithms. You could use PROC FCMP to make your own function, but it is probably NOT worth the effort.
data test; input have @@; test1=round(have,100); test2=100*int(have/100); test3=have-mod(have,100); cards; 111 1499 15251 ;
Obs have test1 test2 test3 1 111 100 100 100 2 1499 1500 1400 1400 3 15251 15300 15200 15200
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Save the date!
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.