A chain operation is used to get a specific record from the database. It is mostly used with the file’s primary key.
This operation blocks the record, so you can modify it later.
If I need to get some records, I use SETLL, SETGT, READ and READP operations, but if I need to get a specific record for update later then I use CHAIN.
In RPG IV you can use %found (if %found …) to determine if the record was found, or you can use an indicator like commonly used in RPG.