Author: John F Dutcher
Subject: Testing rerad cursor for status with predicate
Posted: Fri May 19, 2017 9:35 pm (GMT 5.5)
I tried adding the code below ( inside 100-OPEN) to an existing DB2 program in order to eliminate -501s using the pattern in an IBM manual which uses "predicate' for the call: It fails at compile time with
IGYPS2121-S "READCUR" was not defined as a data-name.
But READCUR is defined in WS:
EXEC SQL
DECLARE READCUR CURSOR FOR
SELECT etc. etc.
Wondering if I can't use DB2 predicates for some reason ?
Code:
100-OPEN.
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
_________________
Java & COBOL trained mainframer with HTML as well
Subject: Testing rerad cursor for status with predicate
Posted: Fri May 19, 2017 9:35 pm (GMT 5.5)
I tried adding the code below ( inside 100-OPEN) to an existing DB2 program in order to eliminate -501s using the pattern in an IBM manual which uses "predicate' for the call: It fails at compile time with
IGYPS2121-S "READCUR" was not defined as a data-name.
But READCUR is defined in WS:
EXEC SQL
DECLARE READCUR CURSOR FOR
SELECT etc. etc.
Wondering if I can't use DB2 predicates for some reason ?
Code:
100-OPEN.
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
_________________
Java & COBOL trained mainframer with HTML as well