DB2 Scalar functions - ARRAY_FIRST
The ARRAY_FIRST function returns the minimum array index value of the array.
The schema is SYSIBM.
The data type of the result is the data type of the array index, which is INTEGER for an ordinary array. If array-expression is not null and the cardinality of the array is greater than zero, the value of the result is the minimum array index value, which is 1 for an ordinary array.
The result can be null; if array-variable is null or the cardinality of the array is zero, the result is the null value.
SET E_CONSTIDX = ARRAY_FIRST(SPECIALNUMBERS)
SET X = ARRAY_FIRST(PHONELIST)
SET NUMBER_TO_CALL = PHONELIST[X]