A few thoughts come to mind, although without seeing the code, it’s hard to know for sure.
1. Have you checked the values in the fields that make up the key list used to chain to this file? Perhaps one or more of the fields in the key list is not being loaded with the value you expect it to have.
2. Another possibility is that the fields in the key list could be in the wrong order. That is possible if you have multiple key fields that have the same size and attributes and they are simply specified in the wrong order in the KLIST.
3. Also, since your error is on an attempt to update, it could be that you are chaining with the correct key values but not moving those values into the corresponding fields in the file when you write the record.
4. Then there is the question of whether the write or update is conditioned by the chain resulting indicator being off or on. It should only write if the indicator is on and update if it is off.
Those are just a few ideas. If none of these are the problem, perhaps you could post enough of the code to help us see what the calcs are doing.
Hope this helps,