Cursors can be declared in both working-storage & procedure
division, Agreed.
But is there any difference? If could you please suggest
what is the difference.
TIA
Answer Posted / budgobbel
In CICS programs, data is passed in the Communications Area (CA) via the Linkage Section.
If your cursor is predicated (WHERE clause) on a field in the CA, you could code your cursor early in the Procedure Division prior to any open cursor logic. This will avoid using additional variables, and MOVE statements.
If you keep your cursor in the Working Storage area, you cannot use fields in the Linkage section as host variables, because the DB2 pre-compiler will see the cursor first, and NOT have a resolution for the host variable (it hasn't seen the Linkage Section, yet).
It mostly is up to you, unless your shop is a stickler on variables and locations, etc.
Also, over the years I have seen shops become more code-it-and-load-it in philosophy. Very sad.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is cursor in dbms?
What is commit in db2?
What is the difference between plan and package in db2?
What is a db2 cursor?
How to access db2 tables in mainframe?
What do you mean by between and in? Is between inclusive of specified range values?
Is db2 a mainframe database?
What does db2 plan contain?
What are the bind parameters ibm db2?
Is db2 free?
How to resolve deadlock issue
What are bind parameters in db2?
For a db2 column that is being defined as decimal (11, 2), discuss the cobol picture clause.
What is a trigger in the db2 database?
What parameters are used to control the free space in DB2?