Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us