The scope ofcursor-nameis the source program in which it is defined; that is, the application program submitted to the precompiler. Thus, you can only refer to a cursor by statements that are precompiled with the cursor declaration. For example, a COBOL program called from another program ca...
This also simplifies the codegen as you do not have to look out for DECLARATIVES at all (at least not for gixsql) and you'd comply with the COBOL standard rule "if any paragraph is in a section, every paragraph must" by implicit inserting them into the last section if there is one....