DSNH506I E csectname LINE nnnn COL cc DECLARE CURSOR FOR STATEMENT NAME MUST PRECEDE THE PREPARE STATEMENT FOR THAT STATEMENT NAME
Explanation
This DECLARE name CURSOR statement is preceded by a PREPARE name statement. In Db2, declarations must precede action statements. This is not the same as in SQL/DS.
System action
The declaration is noted as being in error and discarded.
User response
Move the DECLARE or PREPARE statement so that they are in the proper order, or specify the TWOPASS option if the host language is PLI, ASM, or C. The TWOPASS option has the precompiler check for declarations on the first pass and avoids this problem.
Severity
8 (error)