INARRAY
INARRAY returns a BIT(1) value that indicates whether an expression is equal to any of the elements of an array.
- x
- Scalar expression. x must have a type that is comparable with the type of the elements of y.
- y
- Array expression.
When y is a reference to a one-dimensional STATIC NONASSIGNABLE array with a simple INITIAL list, the compiler assumes the elements of y are constant and processes INARRAY( x, y ) as if it were INLIST( x, ... ) where ... denotes the elements of y.
For example, given
thendcl countryCode char(2); dcl ccs(3) char(2) static nonasgn init( 'AT', 'DE', 'CH' );
is the same asINARRAY( countryCode, ccs )
INLIST( countryCode, 'AT', 'DE', 'CH' )