View previous topic :: View next topic
|
Author |
Message |
bh
New User
Joined: 19 Mar 2006 Posts: 26 Location: India
|
|
|
|
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 |
|
|
pcoreddy
New User
Joined: 14 Mar 2007 Posts: 24 Location: Mysore
|
|
|
|
at end of the a COBOL program , the cursor will be closed automatically |
|
Back to top |
|
|
priyamnavada
New User
Joined: 24 Dec 2005 Posts: 52 Location: hyderabad
|
|
|
|
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 |
|
|
munikumar Currently Banned New User
Joined: 18 Apr 2007 Posts: 24 Location: India
|
|
|
|
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 |
|
|
priyamnavada
New User
Joined: 24 Dec 2005 Posts: 52 Location: hyderabad
|
|
|
|
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 |
|
|
nuthan
Active User
Joined: 26 Sep 2005 Posts: 146 Location: Bangalore
|
|
|
|
It is not a probelm even though you didnt close the cursor. The Cursor will close automatically when the program ends. |
|
Back to top |
|
|
|