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


Please Help Members By Posting Answers For Below Questions

What is the default page size of buffer pools?

650


How to take backup of table in db2?

601


What r the comman abends in db2, jcl and cobol???????

1820


Which are the db2 tools to protect integrity of the database?

692


what is the role of the cursor in db2?

643






What is a system catalog table in db2?

590


What is drop table?

584


What is a db2 table?

597


What is the maximum size of varchar data type in db2?

647


Mention the way of highlighting as well as putting a cursor to use in a cobol program.

630


What is multi row fetch in db2?

612


Give the name of some fields form sqlca.

614


What is db2 bind process?

761


What is runstats db2?

585


Explain the function of data manager.

635