Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2010
    Posts
    207

    Answered: Compare SQL Results with each other in DB2 z/OS

    Hello friends,

    i created a SQL statement on a table of the sysibm catalog. This query asks the sysibm catalog (table 1 and table 2) from different systems.

    Now I want to compare those outputs with each other and take the larger one (table 1) and minus it with table 2.

    Can anyone here help me on this?

    I tried to save the output with "save data as 'db2.report" but its not working.

    Thanks in advance.

    Best regards,

    DBN00b

  2. Best Answer
    Posted by DNance

    "how are you querying the data from the other subsystem? Are you performing a connect to ssid or are you querying from your target system using a 3 part name? Its been quite awhile since I did this, I think if you do the connect to remote, then connect back to local
    you can't save the data, but if you use the three part name from your local then you should be able to save data. Again, you still haven't said what is preventing you from saving the data, so not much for us to tell you.


    Dave Nance"


  3. #2
    Join Date
    Oct 2007
    Posts
    152
    Provided Answers: 9
    why is it not working?

    Unless you set up a federated server with nick names, you cannot join tables from different subsystems together. So, that puts you back to trying to "SAVE DATA", I guess you have QMF. Either provide us with why its not working and we can help you figure that out or create a copy of the catalog under another schema and unload/load the data from the other system into this shadow of your catalog.

  4. #3
    Join Date
    Jan 2010
    Posts
    207
    Hello,

    thank you for your answer. Yes, I am using QMF. I just want to know how i can save my output as a table and which would be the SQL to compare both results with each other?!

    Thank you again and have a nice day.

    Christian

  5. #4
    Join Date
    Oct 2007
    Posts
    152
    Provided Answers: 9
    how are you querying the data from the other subsystem? Are you performing a connect to ssid or are you querying from your target system using a 3 part name? Its been quite awhile since I did this, I think if you do the connect to remote, then connect back to local
    you can't save the data, but if you use the three part name from your local then you should be able to save data. Again, you still haven't said what is preventing you from saving the data, so not much for us to tell you.


    Dave Nance

Posting Permissions

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