RPG (IBM i / AS/400) · File status code

Status Code 00121

What does Status Code 00121 mean in RPG (IBM i / AS/400)?

The program referenced an array element with a subscript less than 1 or greater than the array's declared number of elements.

Status Code 00121IBM i / OS/400 · ILE RPG

Condition

The program referenced an array element with a subscript less than 1 or greater than the array's declared number of elements.

Fix

Bound the index against %ELEM() before referencing the array, particularly when the index comes from a loop counter, database value, or other external input.

Related file status code