If we run this code sas log will show the following results.
Sas floor decimal.
Round down in sas or floor in sas uses floor function which rounds down the column in sas.
Therefore with the floorz function you might get unexpected results.
Below is a list of formats used for reading the data into sas.
As you can see these results are correct and identical to the results of numeric truncation.
The result is the integer part of the calculated value in the same data type as numeric expression.
If the argument is within 1e 12 of an integer the floor function fuzzes the result to be equal to that integer.
Round off the column in sas is accomplished by round function.
The following example shows positive numeric negative numeric and values with the floor function.
The floorz function does not fuzz the result.
Select floor 123 45 floor 123 45 floor 123 45.
Hi i want to remove the values after decimal places.
D is the number of digits to the right of the decimal.
As bruno sas has said format does not change the underlying value only how it is displayed.
Sas has several ways to round a number to an integer.
You can do this based on an array if you like.
For ex 13 265 should become 13 12 514 should become 12.
Let s see an example of each.