Language Reference |
PROD Function |
The PROD function returns as a single numeric value the product of all nonmissing elements in all arguments. You can pass in as many as 15 numeric matrices as arguments. The PROD function checks for missing values and does not include them in the product. It returns missing if all values are missing.
For example, consider the following statements:
a = {2 1, . 3}; b = prod(a); print b;
For a single argument with at least one nonmissing value, the PROD function is identical to the subscript reduction operator that computes the product. That is, prod(x) and x[#] both compute the product of the elements of x. See the section Subscript Reduction Operators for more information about subscript reduction operators.
Copyright © SAS Institute, Inc. All Rights Reserved.