SQLCODE 507 SQLSTATE 24501
You have probably specified that your SQL cursor is for read only, and then tried to update a row in your table using that cursor. If so, just replace the "for read only" bit of your cursor declaration with "for update". It's a bit like "update or delete without prior read or chain".
...or it could be that you have defined multiple cursors for the same file, their use conditioned on different criteria, and you haven't opened the cursor you are trying to update.
The cursor identified in the update or delete statement is not open. The application program attempted to execute an UPDATE or DELETE WHERE CURRENT OF cursor statement at a time when the specified cursor was not open.