MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compare Internal Table and db2 table....?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
intra73
Beginner


Joined: 26 Apr 2004
Posts: 2
Topics: 2
Location: San Francisco

PostPosted: Fri Sep 17, 2004 11:36 am    Post subject: Compare Internal Table and db2 table....? Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Sep 17, 2004 12:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Fri Sep 17, 2004 1:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Sep 17, 2004 1:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Fri Sep 17, 2004 1:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group