View previous topic :: View next topic |
Author |
Message |
intra73 Beginner
Joined: 26 Apr 2004 Posts: 2 Topics: 2 Location: San Francisco
|
Posted: Fri Sep 17, 2004 11:36 am Post subject: Compare Internal Table and db2 table....? |
|
|
Is it possible to compare an internal table and a db2 table.
The background for this question is:
We have a table where we store Billing Accounts and their parent billing accounts on System A. There is no way for System B to be able to tell us accounts that have been removed from their system (B). All they can send us is what they have in their system marked as System A accounts. So the business has given us requirements to use the daily file we get from System B and any billing accounts that are not in the file, but are still in our DB2 table need to be disconnected. I am trying to figure out the easiest way to do this, and wanted to ask you if there is a way to maybe load the file into an internal table and perform some sort of compare between the internal table and a DB2 table where accounts in the DB2 table that are not in the internal table are selected? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Sep 17, 2004 12:30 pm Post subject: |
|
|
Intra73,
Hmm may be I am missing something but , isn't this a simple task of
[1.] Read the file sent from system B
[2.] Look up the record in the table on system A using a select statement
[3.] If found perform the action to be done
[4.] Repeat this process untill you reach the eof
I don't understand as to why we need an internal table in here.
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Bithead Advanced
Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Fri Sep 17, 2004 1:04 pm Post subject: |
|
|
Kolusu,
I think that Intra73 is looking to identify those not in the file in which case, I would create a cursor in System A sorted in the same manner as the file from B and run a match program or I would dump the rows from A and run them through some sort of compare utility. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Sep 17, 2004 1:29 pm Post subject: |
|
|
Quote: |
I think that Intra73 is looking to identify those not in the file in which case, I would create a cursor in System A sorted in the same manner as the file from B and run a match program or I would dump the rows from A and run them through some sort of compare utility.
|
Bithead,
hmm do we need a program with cursor? If you are planning to match using sort/easytrieve utility then you can simply UNLOAD the table and compare it with the file.
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Bithead Advanced
Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Fri Sep 17, 2004 1:31 pm Post subject: |
|
|
But if a cursor is used, any entry in DB2 that is not in the file can be "disconnected" immediately without having to read in the output from the compare utility. |
|
Back to top |
|
|
|
|