RPG (IBM i / AS/400) · File status code
What does Status Code 00122 mean in RPG (IBM i / AS/400)?
An OCCUR operation (or the %OCCUR built-in used to set the current occurrence) specified an occurrence number outside the range defined for a multiple-occurrence data structure.
An OCCUR operation (or the %OCCUR built-in used to set the current occurrence) specified an occurrence number outside the range defined for a multiple-occurrence data structure.
Check the occurrence number against the data structure's declared OCCURS count before calling OCCUR, and reset it to a valid value when a loop runs past the last occurrence.