View previous topic :: View next topic
|
Author |
Message |
baramesh
New User
Joined: 20 May 2008 Posts: 25 Location: bangalore
|
|
|
|
Hi Forum,
While Iam scaninig through the production system, I found in some cobol db2 programs the cursor is declared in Procedure division but not in working storage section. When do we declare cursor in procedure division.what is the advantage.Which is better .Please suggest me.
Thanks,
Ramesh. |
|
Back to top |
|
|
Sinkaravelan S
New User
Joined: 21 Apr 2008 Posts: 27 Location: coimbatore-TN india
|
|
|
|
There is no difference in declaring a cursor in working storage or procedure division. The only constraint with declaring a cursor is that it should be done before any OPEN CURSOR statement.
Thanks, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
When do we declare cursor in procedure division. |
In many organizations there are coding standards that dictate which to use.
I'd recommend you find out if there is a standard where you are and to follow that standard.
The advantage of one way over another is that if your code violates standards, it may not be promotable. |
|
Back to top |
|
|
baramesh
New User
Joined: 20 May 2008 Posts: 25 Location: bangalore
|
|
|
|
Sinkaravelan S wrote: |
There is no difference in declaring a cursor in working storage or procedure division. The only constraint with declaring a cursor is that it should be done before any OPEN CURSOR statement.
Thanks, |
Thanks a lot Mr Sinkaravelan S |
|
Back to top |
|
|
|