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
 

 

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: 6966
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
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
This topic is locked: you cannot edit posts or make replies. Job Opening for 3 to 10 yrs exp. in I... princeaggarwal Mainframe Jobs 0 Sat Aug 20, 2016 3:17 pm
No new posts PL/I: opening file w/ dynamically det... Sam Dodgers PL/I & Assembler 6 Wed Jul 27, 2016 4:05 pm


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