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
 

 

What happens when one doesn't close the cursor in a COBOL

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

New User


Joined: 19 Mar 2006
Posts: 26
Location: India

PostPosted: Wed Jun 06, 2007 2:41 pm    Post subject: What happens when one doesn't close the cursor in a COBOL
Reply with quote

Hi,

What happens when one doesn't close the cursor in a COBOL program and try to run the program ?


Regards,
bh
Back to top
View user's profile Send private message

pcoreddy

New User


Joined: 14 Mar 2007
Posts: 24
Location: Mysore

PostPosted: Wed Jun 06, 2007 3:52 pm    Post subject: Re: What happens when one doesn't close the cursor in a COBO
Reply with quote

at end of the a COBOL program , the cursor will be closed automatically
Back to top
View user's profile Send private message
priyamnavada

New User


Joined: 24 Dec 2005
Posts: 52
Location: hyderabad

PostPosted: Wed Jun 06, 2007 4:00 pm    Post subject:
Reply with quote

if you try to open the same cursor again in the logic -502 error will occur.

-502 THE CURSOR IDENTIFIED IN AN OPEN STATEMENT IS ALREADY OPEN

Explanation: The application program attempted to execute an OPEN
statement for a cursor that was already open.

System Action: The statement cannot be executed. The cursor was unchanged
(that is, it was not 'reopened').

Programmer Response: Correct the logic of the application program to
ensure that it does not attempt to execute an OPEN statement for a cursor
that is already open.
Back to top
View user's profile Send private message
munikumar
Currently Banned

New User


Joined: 18 Apr 2007
Posts: 24
Location: India

PostPosted: Thu Jun 07, 2007 10:00 am    Post subject:
Reply with quote

Hi priyamnavada,

I believe, it will not give Open error, when we execute the program again. Because the program will close the cursor automatically when it ends. (Unless we specity WITH HOLD option).

Can you please give me the more details, if I am wrong?

Regards
Munikumar G
Back to top
View user's profile Send private message
priyamnavada

New User


Joined: 24 Dec 2005
Posts: 52
Location: hyderabad

PostPosted: Thu Jun 07, 2007 3:31 pm    Post subject:
Reply with quote

I am telling like in a particular execution of program, if the logic is to fetch a cursor for say 5 times, then it will be a problem.

if we try to open a cursor for the second time which is not been closed then it will gives problem.This is what i mean to say.
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Thu Jun 07, 2007 4:33 pm    Post subject: Re: What happens when one doesn't close the cursor in a COBO
Reply with quote

It is not a probelm even though you didnt close the cursor. The Cursor will close automatically when the program ends.
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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am


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