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

curser declaration in procedure div. & ws-section


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

New User


Joined: 26 Feb 2007
Posts: 9
Location: kolkatta

PostPosted: Wed Mar 21, 2007 10:26 am
Reply with quote

is there any diff. between the curser declaration in procedure div. & working storage section ?
------ plz tell as soon as possible
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Mar 21, 2007 10:32 am
Reply with quote

Hi There,


Topic is already discussed
www.ibmmainframes.com/viewtopic.php?t=18335&highlight=cursor+declare
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Mar 21, 2007 5:28 pm
Reply with quote

Hi guptae,

In the link provided by u, All gave their assumptions but none are confident. Can somebody else please give the exact answer here.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Mar 21, 2007 5:39 pm
Reply with quote

mkk157 wrote:
In the link provided by u, All gave their assumptions but none are confident. Can somebody else please give the exact answer here.
You are right, a lot of assumptions, some wrong. But it all boils down to:
Quote:
A static cursor needs to be declared before it is opened. The DB2 preprocesser needs to see it before it generates the code for accessing it. .........the declaration generates no executable code in itself so it is usually placed in the data division, that helps keep the procedure division cleaner and easier to see the logic flow.
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Wed Mar 21, 2007 6:54 pm
Reply with quote

Thats right. You can see the precompiled code. The precompiler just comments the CURSOR decalaration and does not put any code as a replacement for that.

Where as after Fetch you could see the equivalent DSNHLI calls.
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 COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts FD Section to Create FB or Vb File Dy... COBOL Programming 1
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
Search our Forums:

Back to Top