Closing a Cursor

When the cursor has completed its work, usually by encountering no more data, you must CLOSE it.

Syntax

EXEC SQL
    CLOSE cursorname
END-EXEC.

Example

EXEC SQL
    CLOSE COBCUR1
END-EXEC.