Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

SUM Function

sums all elements

SUM( matrix1<, matrix2,..., matrix15>)

where matrix is a numeric matrix or literal.

The SUM function returns as a single numeric value the sum of all the elements in all arguments. There can be as many as 15 argument matrices. The SUM function checks for missing values and does not include them in the accumulation. It returns 0 if all values are missing.

For example, the statements

   a={2 1, 0 -1};
   b=sum(a);
return the scalar
                B             1 row       1 col     (numeric)

                                          2

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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