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

Is db2 free?

684


How does coalesce work?

584


What does db2 plan contain?

573


How would the varchar column remarks defined?

635


What is a storage group (stogroup)?

774






What is the physical storage length of timestamp data type?

641


What is the maximum size of a char data type in db2?

586


Is db2 a database?

572


by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?

7506


what is the responsibility of the construction superintendent

1660


How does a cursor work?

554


What is db2?

739


Before you give the explain statement, what are the prerogatives?

579


What is a db2 cursor?

622


Differentiate between cs and rr isolation levels? Where do you specify them?

580