Language Reference

ALL Function

checks for all nonzero elements

ALL( matrix)

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 a\gt{b} 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 a is greater than the corresponding element of b.

For example, consider the following statement:

  
    if all(a>b) then goto loop;
 
IML executes the GOTO statement only if every element of a is greater than the corresponding element of b. 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;
 

Previous Page | Next Page | Top of Page