VAR Function

Returns the variance of the nonmissing arguments.

Categories:Aggregate
Descriptive Statistics
Restriction:Aggregate functions take one argument. When more than one argument is used within a SQL aggregate function, the function is no longer considered to be a SQL aggregate or summary function and a like-named SAS function is used instead. See VAR Function in SAS Functions and CALL Routines: Reference.
Returned data type:Numeric

Syntax

VAR (<ALL | DISTINCT> sql-expression)

Required Argument

sql-expression

specifies any valid SQL expression. See sql-expression Component.

Optional Arguments

ALL

(default) specifies that all missing values returned by sql-expression be counted.

DISTINCT

eliminates duplicate rows returned by sql-expression from the count.

Last updated: April 9, 2026