Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Cursor declaration in Procedure Division

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
baramesh

New User


Joined: 20 May 2008
Posts: 21
Location: bangalore

PostPosted: Thu Jun 05, 2008 10:04 am    Post subject: Cursor declaration in Procedure Division
Reply with quote

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
View user's profile Send private message

Sinkaravelan S

New User


Joined: 21 Apr 2008
Posts: 27
Location: coimbatore-TN india

PostPosted: Thu Jun 05, 2008 2:22 pm    Post subject: Reply to: Cursor declaration in Procedure Division
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jun 05, 2008 7:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
baramesh

New User


Joined: 20 May 2008
Posts: 21
Location: bangalore

PostPosted: Fri Jun 06, 2008 2:44 pm    Post subject: Re: Reply to: Cursor declaration in Procedure Division
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts -502 Error - Cursor already open anand jeyapaul DB2 7 Sun Oct 29, 2017 4:22 am
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us