DB2 v7.1 z/OS - Access UDB v8.1 table from Cobol on the Mainframe

Byron Pierce

DB2 v7.1 z/OS - Access UDB v8.1 table from Cobol on the Mainframe
Hi Listers...

Has anyone out there done anything with accessing UDB tables from mainframe
Cobol programs ? I've already successfully accessed UDB tables from DB2I -
SPUFI so I think I have all the CDB data setup correctly. Any advice,
examples, words of wisdom would be greatly appreciated.

Thanks in advance for the help !!!!!

Byron C. Pierce
Prudential Retirement Technology
Database Services
One Commercial Plaza - H07B
Work: 860.534.4222
Mail: [login to unmask email]

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Steve Whittaker

Re: DB2 v7.1 z/OS - Access UDB v8.1 table from Cobol on the Mainframe
(in response to Byron Pierce)
Bryon:
I've done something like this using our DB2 (Websphere) Information
Integrator product. We now have a Cobol program that accesses both DB2
data on z/OS and joins it with data from an Oracle table and also
combines in a table on our DB2 UDB server.
Feel free to email me off-line from the forum if you'd like.

--Steve....

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Byron C. Pierce
Sent: Friday, January 12, 2007 10:41 AM
To: [login to unmask email]
Subject: [DB2-L] DB2 v7.1 z/OS - Access UDB v8.1 table from Cobol on the
Mainframe


Hi Listers...

Has anyone out there done anything with accessing UDB tables from
mainframe
Cobol programs ? I've already successfully accessed UDB tables from DB2I
-
SPUFI so I think I have all the CDB data setup correctly. Any advice,
examples, words of wisdom would be greatly appreciated.

Thanks in advance for the help !!!!!

Byron C. Pierce
Prudential Retirement Technology
Database Services
One Commercial Plaza - H07B
Work: 860.534.4222
Mail: [login to unmask email]

------------------------------------------------------------------------
---------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that
page select "Join or Leave the list". The IDUG DB2-L FAQ is at
http://www.idugdb2-l.org. The IDUG List Admins can be reached at
[login to unmask email] Find out the latest on IDUG conferences
at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Walter Trovijo Jr (UOL)

Re: DB2 v7.1 z/OS - Access UDB v8.1 table from Cobol on the Mainframe
(in response to Steve Whittaker)
>
> Has anyone out there done anything with accessing UDB tables from mainframe
> Cobol programs ? I've already successfully accessed UDB tables from DB2I -
> SPUFI so I think I have all the CDB data setup correctly. Any advice,
> examples, words of wisdom would be greatly appreciated.
>
> Thanks in advance for the help !!!!!
>

Byron,

In our shop we have just a few programs accessing remote data which is actually in Oracle going thru DB2 UDB OLE/DB table functions, but the setup would be the same for DB2 UDB tables from DB2 Z point of view. In our case we decided to write a stored procedure to access remote data - because access always consist of opening a cursor, no updates or random access - and that appeared to be a good solution instead of building a new kind of compile/bind specific to the programs acessing both local and remote tables. We also tested once moving a database to a z/Linux LPAR; that case was easier, we just rebound all packages pointing to remote location in a different set of plans; pointing to the 'alternative' plans would point to remote tables. Others might need to do all kinds of accesses, random, sequential, update/delete/insert. You can choose to mix both local and remote table acesses in a single program or code subroutines specifically to this purpose. It all depends on your needs; our choice was to give a specific solution for a specific requirement and in this case, of course, it will not cover several situations but that might work for you.
If you can provide more information about what you want to do, we can go further and maybe I can give you some useful information based on what we have done here - which is not that much, however.

Regards,
Walter Trovijo Jr

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Lynne Flatley

Re: DB2 v7.1 z/OS - Access UDB v8.1 table from Cobol on the Mainframe
(in response to Walter Trovijo Jr (UOL))
I did it many years ago at another company but it's pretty easy...

You need to have the UDB database as a location in the SYSIBM.LOCATIONS
table. This is what the program connects to.

Here are the package bind control cards...

REBIND PACKAGE (AAAA.COLLECTION_NAME.PROGNAME) ENABLE(*)+
OWNER(valid owner) QUALIFIER(whatever) VALIDATE(BIND)+
FLAG(I) CURRENTDATA(NO) ISOLATION(CS)+
RELEASE(COMMIT) EXPLAIN(YES) DEGREE(1)+
DYNAMICRULES(BIND) KEEPDYNAMIC(NO) NOREOPT(VARS)+
DBPROTOCOL(DRDA) IMMEDWRITE(NO) ENCODING(37)

END

AAAA is the UDB database name
COLLECTION_NAME is whatever you'd typically use
The OWNER parm should be the ID of an ID on the server
QUALIFIER should be the table creator.

Then, this package needs to be bound to a plan on the mainframe.

I can't test this right now, some of the parms may be extraneous. The
DB2 manual should indicate which ones work on a cross-platform bind.

Lynne Flatley


"Insanity: doing the same thing over and over again and expecting
different results. " - Albert Einstein





-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Byron C. Pierce
Sent: Friday, January 12, 2007 10:41 AM
To: [login to unmask email]
Subject: [DB2-L] DB2 v7.1 z/OS - Access UDB v8.1 table from Cobol on the
Mainframe

Hi Listers...

Has anyone out there done anything with accessing UDB tables from
mainframe Cobol programs ? I've already successfully accessed UDB tables
from DB2I - SPUFI so I think I have all the CDB data setup correctly.
Any advice, examples, words of wisdom would be greatly appreciated.

Thanks in advance for the help !!!!!

Byron C. Pierce
Prudential Retirement Technology
Database Services
One Commercial Plaza - H07B
Work: 860.534.4222
Mail: [login to unmask email]

------------------------------------------------------------------------
---------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that
page select "Join or Leave the list". The IDUG DB2-L FAQ is at
http://www.idugdb2-l.org. The IDUG List Admins can be reached at
[login to unmask email] Find out the latest on IDUG conferences
at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm