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 the default page size of buffer pools?
How to take backup of table in db2?
What r the comman abends in db2, jcl and cobol???????
Which are the db2 tools to protect integrity of the database?
what is the role of the cursor in db2?
What is a system catalog table in db2?
What is drop table?
What is a db2 table?
What is the maximum size of varchar data type in db2?
Mention the way of highlighting as well as putting a cursor to use in a cobol program.
What is multi row fetch in db2?
Give the name of some fields form sqlca.
What is db2 bind process?
What is runstats db2?
Explain the function of data manager.