SIGN Function

Returns the sign of a value.

Category: Mathematical

Syntax

SIGN(argument)

Required Argument

argument

specifies a numeric constant, variable, or expression.

Details

The SIGN function returns the following values:
-1
if argument < 0
0
if argument = 0
1
if argument > 0.

Example

The following SAS statements produce these results.
SAS Statement
Result
x=sign(-5);
-1
x=sign(5);
1
x=sign(0);
0