I have pulled very simple code from IBM manual which demonstrates a simple test to determine cursor status (and I gather, avoid either -501 or -502 SQLCODES).
IF READCUR IS OPEN
EXEC SQL
CLOSE READCUR
END-EXEC
EXEC SQL
OPEN READCUR
END-EXEC
ELSE
EXEC SQL
OPEN READCUR
END-EXEC
END-IF
READCUR is defined in WS:
EXEC SQL
DECLARE READCUR CURSOR FOR
SELECT
etc.etc.
But at compile time the compiler throws a '14' return and says READCUR is undefined. The program is an old one and has run for years
but my attempt to insert the test for open cursor is stymied.
Is it that my DB2 / COBOL environment doesn't allow using DB2 predicates (at least for a cursor) ?
Using DB2 "predicate" for cursor
-
- Global moderator
- Posts: 3025
- Joined: Sun Jul 04, 2010 12:13 am
- Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
- Referer: Google
- Location: Pushing up the daisies (almost)
Re: Using DB2 "predicate" for cursor
Locked - discussed on the Expert's forum.
Also - nothing is "thrown" on MVS, its predecessors or its successors.
Also - nothing is "thrown" on MVS, its predecessors or its successors.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
Regards
Nic
-
- Similar Topics
- Replies
- Views
- Last post
-
- 11
- 3805
-
by Pedro
View the latest post
Tue Dec 27, 2022 11:24 am
-
-
Commit issued without hold and without close cursor statemen
by ravi11081992 » Sat Jan 22, 2022 2:42 pm » in DB2 - 2
- 2262
-
by engh
View the latest post
Tue Sep 20, 2022 6:07 pm
-