Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

ANY Function

checks for any nonzero element

ANY( matrix)

where matrix is a numeric matrix or literal.

The ANY function returns a value of 1 if any of the elements in matrix are nonzero. If all the elements of matrix are zeros, the ANY function returns a value of 0. Missing values in matrix are treated as zeros.

For example, consider the statement

   if any(a=b) then print a b;
The matrices A and B are printed if at least one value in A is the same as the corresponding value in B. The following statements do not print the message:
   a={-99 99};
   b={-99 98};
   if a^=b then print 'a^=b';
However, the following statement prints the message:
   if any(a^=b) then print 'a^=b';

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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