I am trying to declare a cursor in the procedure division, but it is giving error.
I have declared the same cursor in the Working storage section and it is working fine.
Can any body pls tell me the reason.
Joined: 11 Jun 2007 Posts: 80 Location: Columbus, Ohio
How does this effects the Cursor declaration
Exactly as the results have shown:
CURSOR "PROD-LDCACCT" WAS NOT DECLARED
It is not an executable statement.
As Dick indicated, the cursor declaration must be PHYSICALLY located above/before the OPEN cursor statement. Best practices are to either declare the cursor in working storage OR immediately before your open cursor statement. Just be consistent and/or follow your shop standards.