By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,924 Members | 1,651 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,924 IT Pros & Developers. It's quick & easy.

How to create a cobol subroutine(sub PGM) as DB2 interface

P: 1
Hi guys:

I am a mainframe cobol programmer, and now i need some helps.

I want to write a cobol subroutine it can provide functions for accessing DB2.

ex. there is a subroutine called DBI0000.
In cobol program, I can access DB2 use the DBI0000 as below.

CALL DBI0000 USING PARM-OPTION
PARM-KEY
PARM-TABLE
PARM-DATA-AREA.

In my mind,the PARM-OPTION will be SELECT,OPEN,FETCH,CLOSE etc.
the PARM-KEY is the access key
the PARM-TABLE is the db2 table that I read
and the PARM-DATA-AREA is the result.

I can do the SELECT function by myself,
but I have no ideas for writing the CURSOR function.
Whether there some ways to provide the CURSOR function instead of SQL OPEN,FETCH,CLOSE statement.

Could someone can help me or give me some tips(samples).

Thanks for your help in advance.

Regards.
Dec 11 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.