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

Status Code 00122

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.

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

Condition

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.

Fix

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.

Related file status code