ABS Function

Returns the absolute value.

Category: Mathematical

Syntax

ABS (argument)

Required Argument

argument

specifies a numeric constant, variable, or expression.

Details

The ABS function returns a nonnegative number that is equal in magnitude to the magnitude of the argument.

Example

The following SAS statements produce these results.
SAS Statement
Result
x=abs(2.4);
2.4
x=abs(-3);
3