RANGE Function

Returns the range of the nonmissing values.

Category: Descriptive Statistics

Syntax

RANGE(argument-1<,...argument-n> )

Required Argument

argument

specifies a numeric constant, variable, or expression. At least one nonmissing argument is required. Otherwise, the function returns a missing value. The argument list can consist of a variable list, which is preceded by OF.

Details

The RANGE function returns the difference between the largest and the smallest of the nonmissing arguments.

Example

The following SAS statements produce these results.
SAS Statement
Result
x0=range(.,.);
.
x1=range(-2,6,3);
8
x2=range(2,6,3,.);
4
x3=range(1,6,3,1);
5
x4=range(of x1-x3);
4