If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DSNREXX (Connecting to DB2 - z/OS to z/OS)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-19-04, 12:29
hatcherd hatcherd is offline
Registered User
 
Join Date: Jan 2004
Location: USA
Posts: 3
Question DSNREXX (Connecting to DB2 - z/OS to z/OS)

I've written a REXX program which reads SYSIBM.SYSCOPY for image copy datasets used for RECOVER. My problem is that my CONNECT statement fails with a SQLCODE -107 when issued for a DB2 subsystem on another z/OS processor. I'm looking for suggestions to point me in the right direction.
Reply With Quote
  #2 (permalink)  
Old 01-30-04, 07:37
Heinz Buehler Heinz Buehler is offline
Registered User
 
Join Date: Jan 2004
Location: Zuerich, Switzerland
Posts: 13
You cannot connect to a DB2 System on a different processor from a REXX program. There are two things you can do:
1. connect to a local DB2 system, and use the DB2 PRIVATE protocol, i.e. a three-part-name to read tables on the remote DB2 system
2. for data sharing systems install a additional DB2 member on your local machine and connect to this.
In out installation, i have REXX programs using both methods.
have fun
Reply With Quote
  #3 (permalink)  
Old 01-30-04, 09:02
Heinz Buehler Heinz Buehler is offline
Registered User
 
Join Date: Jan 2004
Location: Zuerich, Switzerland
Posts: 13
My answer above may be misleading:
1.) should say 'you cannot connect to a DB2 system on a remote processor. The REXX program must first do a CAF CONNECT and OPEN to a DB2 System on the local processor, and then can either issue a SQL CONNECT command to the remote DB2 in order to read data from there. Alternately, you can use three part names for the remote tables. The program must alwasy first CAF connect to a local DB2, then SQL CONNECT or use three part names. Both DB2 systems must be connected with DDF links.
Reply With Quote
  #4 (permalink)  
Old 02-05-04, 07:34
hatcherd hatcherd is offline
Registered User
 
Join Date: Jan 2004
Location: USA
Posts: 3
DSNREXX (Connecting to DB2 - z/OS to z/OS)

Heinz...thanks for the suggestion. I was successfully able to connect to the remote DB2, however my SQL OPEN (EXECSQL OPEN C1) is failing REXX RC=1. I've attempted unsuccessfully to use three-part name in my SELECT but it appears that the DB2 I'm running on does not allow that option (SQLCODE -512).
Reply With Quote
  #5 (permalink)  
Old 02-05-04, 08:09
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
As Heinz mentioned, you need the Distributed Data Facility (DDF) configured and started. Talk to your DB2 Systems Programmer.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 02-08-04, 12:07
Heinz Buehler Heinz Buehler is offline
Registered User
 
Join Date: Jan 2004
Location: Zuerich, Switzerland
Posts: 13
check:
- has the DB2 REXX Support has been installed at the remote DB2 system (this is feature that must be installed separately, and you need the REXX support packages bound at the remote DB2 system if you use the DRDA protocol, you don't need them if you use PRIVATE protocol - remember that PRIVATE protocol works only between DB2 for MVS'es))
- if one of the DB2 systems is not on a mainfraime, you can only use DRDA protocol - that means that Queries are shipped to the remote site without resolving object names, i.e. all names mentioned in the queries must be resolvable at the remote site

if that all does not help, email me, i'll send a sample REXX out of my collection

greetings, Heinz
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On