Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Location
    USA
    Posts
    3

    Question Unanswered: 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.

  2. #2
    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

  3. #3
    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.

  4. #4
    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).

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  6. #6
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •