Sample 24662: Return the integer of a value
Use the INT function to return only the integer portion of
an argument.
Note:
The INT function returns the integer portion of the argument (truncates the decimal portion). If the argument's value is
within 10**(-12) of an integer, the function results in that
integer. If the value of argument is positive, INT(argument) has
the same result as FLOOR(argument). If the value of argument is
negative, INT(argument) has the same result as CEIL(argument).
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
data a;
input x;
y=int(x);
datalines;
2.1
-2.4
3
2.99
;
proc print;
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Obs x y
1 2.10 2
2 -2.40 -2
3 3.00 3
4 2.99 2
Use the INT function to return only the integer portion of
an argument.
| Type: | Sample |
| Topic: | SAS Reference ==> DATA Step SAS Reference ==> Functions ==> Truncation
|
| Date Modified: | 2005-12-16 03:02:56 |
| Date Created: | 2004-09-30 14:09:02 |
Operating System and Release Information
| SAS System | Base SAS | All | n/a | n/a |