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
 
Handle RC while opening the cursor

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

New User


Joined: 21 Dec 2009
Posts: 10
Location: Kolkata

PostPosted: Sat Oct 30, 2010 9:24 am    Post subject: Handle RC while opening the cursor
Reply with quote

Hi,

I would like to which one of the following is good cobol program writing practice:
Should we handle return code while declaring a cursor OR
it is enough if we handle RC while opening the cursor?
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Oct 30, 2010 10:17 am    Post subject:
Reply with quote

Hello,

What error codes have you seen that were caused by a DECLARE CURSOR?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Oct 30, 2010 5:47 pm    Post subject:
Reply with quote

if you look at the compiler listing, there is no code generated for the declare cursor, so no need to check the sqlcode. actually the declare cursor (in addition to other things) is part of the DSNSQL SECTION which is executed as soon as your program is invoked (the first time).

So, if you declare a cursor and then check the sqlcode that has not been initialized, you are using either garbage from the module load or the sqlcode of a previous db2 call.

so, NO. no sqlcode check after a declare cursor - a mistake that many make.
Back to top
View user's profile Send private message
moumi das
Warnings : 1

New User


Joined: 21 Dec 2009
Posts: 10
Location: Kolkata

PostPosted: Tue Nov 02, 2010 9:53 am    Post subject: Reply to: Handle RC while opening the cursor
Reply with quote

Thanks icon_biggrin.gif
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Mainframe Opening in Chennai ( 2 to 4... muralikrishnan_new Mainframe Jobs 0 Tue Jul 18, 2017 2:20 pm
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm

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