Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to display offset thru cobol prog... tvinodkumar7 CICS 2 Sun Apr 22, 2018 8:42 pm
No new posts Linkage editor is part of COBOL, z/OS... ankit.jain COBOL Programming 4 Fri Apr 20, 2018 4:17 pm
This topic is locked: you cannot edit posts or make replies. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm
No new posts COBOL MVS options BiswajitDG COBOL Programming 8 Fri Apr 06, 2018 12:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us