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

How do I copy a table in db2?

573


Explain dclgen.

722


List out the buffer pools in db2

628


What is dclgen (declaration generator)?

601


When do you specify the isolation level?

608






List down the types of triggers in the db2 database?

590


What is multi row fetch in db2?

603


What is runstats and reorg in db2?

796


How do I delete a table in database?

597


What is a bind in db2?

592


What is a db2 cursor?

624


What is the purpose of rollback and commit?

594


What is the default page size of buffer pools?

646


How many databases can be created inside an instance in db2 ?

599


What db2 400?

677