Language Reference |
checks for all nonzero elements
where matrix is a numeric matrix or literal.
The ALL function returns a value of 1 if all elements in matrix are nonzero. If any element of matrix is zero, the ALL function returns a value of 0. Missing values in matrix are treated as zeros.
You can use the ALL function to express the results of a comparison operator as a single 1 or 0. For example, the comparison operation yields a matrix containing elements that can be either ones or zeros. All the elements of the new matrix are ones only if each element of is greater than the corresponding element of .
For example, consider the following statement:
if all(a>b) then goto loop;IML executes the GOTO statement only if every element of is greater than the corresponding element of . The ALL function is implicitly applied to the evaluation of all conditional expressions.
The following statements have the same effect:
if (a>b) then goto loop;
if all(a>b) then goto loop;
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.