hi . . we are writing some Cobol/Db2 subroutines. The cursors in the subroutines are declared in the linkage section instead of Working storage section. The routines are tested and working fine. Do you see any problem with declaring the cursors in Linkage section?
CURSOR Declarations are something like a Working Storage Variable declaration. It is not an executable statement.
If you check the COBOL compile listing for the same, the CURSOR declaration will be commented. Usually SQL statements will be replaced with corresponding COBOL call during compilation. Only OPEN CURSOR statement is executable and not DECLARE Statement.
I have tested this with DB2 Stored procedure and it worked fine.