Chapter Contents

Previous

Next
SIGN

SIGN



Returns the sign of a value

Category: Mathematical


Syntax
Required argument
Details
Examples

Syntax

SIGN(argument)

Required argument

argument
is numeric.


Details

The SIGN function returns a value of
-1 if x < 0
0 if x = 0
1 if x > 0.


Examples

SAS Statements Results
x=sign(-5);
-1
x=sign(5);
1
x=sign(0);
0


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.