Previous Page | Next Page

Functions and CALL Routines

N Function



Returns the number of non-missing numeric values.
Category: Descriptive Statistics

Syntax
Arguments
Comparisons
Examples

Syntax

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


Arguments

argument

specifies a numeric constant, variable, or expression. At least one argument is required. The argument list can consist of a variable list, which is preceded by OF.


Comparisons

The N function counts nonmissing values, whereas the NMISS and the CMISS functions count missing values. N requires numeric arguments, whereas CMISS works with both numeric and character values.


Examples

SAS Statements Results
x1=n(1,0,.,2,5,.);
4
x2=n(1,2);
2
x3=n(of x1-x2);
2

Previous Page | Next Page | Top of Page