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
 

 

why we are linking a cob-db2 with SP using DSNRLI?

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

Active User


Joined: 15 Dec 2005
Posts: 237

PostPosted: Wed Jun 23, 2010 8:02 pm    Post subject: why we are linking a cob-db2 with SP using DSNRLI?
Reply with quote

Folks,

In my project, a cob-db2 program is used just to open a cursor.(declare cursor is used with return option) and it is link-edited with DDL(i.e. stored procedure) using DSNRLI. why we need to develop a cob-db2 program and to open a cursor instead it can be coded inside the DDL of Stored procedure itself. Don't ask me that why you didn't ask the question to your colleague, since they follow this method for so many years they are sticking to it.

sample code of cob db2
Code:


EXEC SQL DECLARE C4 CURSOR WITH HOLD WITH RETURN FOR
           SELECT PROJNO, PROJNAME
           FROM DSN8910.PROJ
           WHERE DEPTNO = 'A01';

Procedure division
.
.
exec sql
open c 4
end-exec





Thanks,
Murali.
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: Wed Jun 23, 2010 9:47 pm    Post subject:
Reply with quote

Hello,

Quote:
why we need to develop a cob-db2 program and to open a cursor instead it can be coded inside the DDL of Stored procedure itself
Because that is the convention in your environment.

If the enviuronment has been running for a very long time, the people who made the rules may have already gone elsewhere leaving behind no explanation as to why one way was chosen rather than some other.

Suggest that if everything works as-is, you continue with the current convention. A review and change may be in order, but this should not be done without agreement/direction from management. . .
Back to top
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Thu Jun 24, 2010 5:31 pm    Post subject: Reply to: why we are linking a cob-db2 with SP using DSNRLI?
Reply with quote

Mostly because that is how IBM designed those things and interfaces that open cursor can't be coded in SP DDL. But with Db2 V9 a lot of procedural SQLs are allowed in SP DDL and you need not use external application languages like COBOL depending on your requirement.
Back to top
View user's profile Send private message
smachohalla

New User


Joined: 25 Mar 2008
Posts: 6
Location: Chennai

PostPosted: Thu Apr 07, 2011 7:52 pm    Post subject:
Reply with quote

Hey ive come across situations like this. If a called sub program (cobdb2) just opens a cursor, then the recordset of the cursor is returned back to the calling program. This is the point here. Also those kind of cursor are declared with 'WITH RETURN' keyword as given in your code., this means the whole cursor recordset content is returned back to the calling pgm
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 Authorization for compiling and linki... Abhi Nature All Other Mainframe Topics 5 Thu Mar 12, 2015 3:09 pm
No new posts COBOL programs dynamic linking shreya19 COBOL Programming 24 Tue Jul 15, 2014 5:58 am
No new posts Problem while linking to a dynamicall... nivedita.mukherjee16 IMS DB/DC 6 Wed Nov 23, 2011 6:17 pm
No new posts LINKing DB2 Module AneeshMani CICS 10 Tue Oct 04, 2011 7:50 am
No new posts Problem linking AMODE64 + ICSF = DLL ... HenriqueS All Other Mainframe Topics 2 Tue Jan 25, 2011 4:47 am


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