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
 

 

Wwhat happens if we dont close cursor in db2-cobol pgm?

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

New User


Joined: 16 Apr 2007
Posts: 50
Location: Pune

PostPosted: Fri Jan 08, 2010 4:39 pm    Post subject: Wwhat happens if we dont close cursor in db2-cobol pgm?
Reply with quote

What happens if we dont close cursor in db2-cobol pgm?
And after that again i'm trying to open Cursor.
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Jan 08, 2010 4:44 pm    Post subject:
Reply with quote

Why don't you try it??? And let people here know if anything you are not clear with?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri Jan 08, 2010 4:47 pm    Post subject:
Reply with quote

Quote:
What happens if we dont close cursor in db2-cobol pgm?


it will be closed by db2 at end of task.

Quote:
And after that again i'm trying to open Cursor.

if you are trying to open an 'open' cursor, you will receive an error from db2.

answers to both questions can be found in
Back to top
View user's profile Send private message
Amolondhe007
Warnings : 1

New User


Joined: 16 Apr 2007
Posts: 50
Location: Pune

PostPosted: Fri Jan 08, 2010 4:48 pm    Post subject: Reply to: Wwhat happens if we dont close cursor in db2-cobol
Reply with quote

Sambhaji,

I think there will be no know but if you are trying to open it again at that time it will error.
I think it will show 502 error..Let me correct if i'm not wrong.

Thanks,
Amol
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Jan 08, 2010 5:04 pm    Post subject:
Reply with quote

Quote:

I think there will be no know but if you are trying to open it again at that time it will error.
I think it will show 502 error..Let me correct if i'm not wrong.

As dick has already mentioned cursor will be closed by db2 at end of task even if you dont close explicitly in your cobol-db2 program.
Back to top
View user's profile Send private message
Keanehelp

New User


Joined: 27 May 2008
Posts: 70
Location: USA, CA.

PostPosted: Sat Jan 09, 2010 2:33 am    Post subject:
Reply with quote

In case you try to open a cursor without closing that cursor you will get an error as ' trying to open a cursor which is already open'.
SQLCODE = -502.
Back to top
View user's profile Send private message
Amolondhe007
Warnings : 1

New User


Joined: 16 Apr 2007
Posts: 50
Location: Pune

PostPosted: Thu Jan 14, 2010 3:28 pm    Post subject:
Reply with quote

Thanks to everyone.....
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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
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
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us