EQA1497S An aggregate cannot be used as an index into an array.

Explanation

Given DCL A(2) FIXED BIN(15) and DCL B(2) FIXED BIN(15), references to A(B), A(B+2), and so on are invalid.

Programmer response

Use a scalar as the index.