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: 6967
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 Testing rerad cursor for status with ... John F Dutcher DB2 7 Fri May 19, 2017 9:35 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


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