IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Cursor declaration in Procedure Division


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
baramesh

New User


Joined: 20 May 2008
Posts: 25
Location: bangalore

PostPosted: Thu Jun 05, 2008 10:04 am
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
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

Moderator Emeritus


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

PostPosted: Thu Jun 05, 2008 7:55 pm
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: 25
Location: bangalore

PostPosted: Fri Jun 06, 2008 2:44 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
No new posts Cond parameter and Rc code of a proce... JCL & VSAM 5
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top