Master Mainframe Technologies - COBOL, JCL, DB2, VSAM, CICS & More
ABEND Codes SQLCODEs File Status Interview Prep Contact
← Back to SQLCODE Reference
Error

SQLCODE -501

Cursor not open

Explanation

FETCH or CLOSE attempted on a cursor that is not open.

Solution

Verify cursor is opened before FETCH. Check program flow for OPEN statement.

Example

FETCH cursor-name before OPEN cursor-name