ALL Function

Purpose

Returns a bit string that is the logical AND of the elements of a bit string array.

Syntax

ALL(x)

Parameters

x is an array expression. If x is not a bit string array, it is converted to one.

Description

The ALL function returns a bit string whose length is equal to the length of the longest bit string value in the array. Each bit of the result is 1 if and only if the corresponding bit exists and has the value 1 in every element of the array.

Examples

DCL BIT_TEST(3) BIT(5) INITIAL ('10011'B, '10111'B, 10110'B);
DCL BIT_RES BIT(5);
BIT_RES = ALL(BIT_TEST);   /* returns '10010'B */