RPG (IBM i / AS/400) · File status code
What does Status Code 01221 mean in RPG (IBM i / AS/400)?
An UPDATE or DELETE was issued for a record without a preceding CHAIN, READ, or similar operation that successfully positioned the file on that record for update.
An UPDATE or DELETE was issued for a record without a preceding CHAIN, READ, or similar operation that successfully positioned the file on that record for update.
Always perform a successful positioning read immediately before UPDATE or DELETE, and check the indicator or %FOUND result before attempting the change.