OR Aggregation Expression

OR { index-set } logic-expression

The OR aggregation operator evaluates the logical expression logic-expression for each member of the index set index-set. The index set enumeration finishes early if the logic-expression evaluation produces a true value (non­zero and non­missing). The result is 1 if a true value is found, or 0 otherwise. The following statements demonstrate both a true and a false result:

proc optmodel;
   put (or{i in 1..5} i = 2); /* returns 1 */
   put (or{i in 1..5} i = 7); /* returns 0 */