INVALID KEY on Rewrite to a Logical file

Hi, I am getting an Invalid key status of 20 when trying to do a REWRITE on a Logical file. The program had initially performed a successful read on the record. What would be causing this? Thank you for any inputs.

Hi - is this Micro Focus or on the mainframe?

Have you checked your record to see that the key is correct? Just Display before Rewrite.

Or the key has changed… check before and after
20 Device or resource busy (Micro Focus). record key values has been violated, or, the prime record key value has been changed by a COBOL program between successful execution of a READ statement and execution of the next REWRITE statement for that file.

This is COBOL 400. Thanks

Thank you for your help.