January 24, 2007, 01:47 PM
FrankDutchcomparing and combining files
We have client data on different systems.
therefore the data entry departments want me to build a report that compares the several sources of data to be sure all the static data of each client is filled in as it should be.
We have a RMS database, an MsSQL system and some data in a sybase database.
I can build reports on all 3 and the do have one field in common (cltnr).
My question is how can I build one report that shows
from RMSdata from sybase from SQL
cltnr name address ....accman department....extra code.....
In some cases the sybase data is not filled, in some the sql and sometimes the RMS data is missing.
I can do this in two ways but witch one is the best.
1) first create 3 hold files HOLDSQL, HOLDRMS and HOLDSYB (format focus index cltnr)
2) create one extra hold file that combines the field "CLTNR" from all the 3 into a HOLDMAST
3) link the 4 files in an outer join from HOLDMAST.
4) build the report
The other way is create a master file, with all the expected fields and put all the data with modify into that focus file.
I'm not sure if the last one is the better, or if the first one is going to work at all.
what should you do.
thanks for the advice!
January 24, 2007, 02:11 PM
ETHow about using match file? This would eliminate your step2 (extra hold file) and having to join the hold files:
MATCH FILE SQLFILE
PRINT SQLFIELDS BY CLTNR
RUN
FILE RMSFILE
PRINT RMSFIELDS BY CLTNR
RUN
FILE SYBFILE
PRINT SYBFIELDS BY CLTNR
AFTER MATCH HOLD OLD-OR-NEW
END
Then just table the resultant hold file.
Good Luck
et
January 24, 2007, 02:15 PM
N.SelphAssuming you have a hub server on Windows, connected to each database, you can do the whole thing in one fex, without creating the hold files or masters:
MATCH FILE rmstable
SUM various rmsfields
BY CLTNR
RUN
MATCH FILE sybasetable
SUM various sybasefields
BY CLTNR
AFTER MATCH HOLD OLD-OR-NEW
RUN
MATCH FILE mssqltable
SUM various mssql fields
BY CLNTR
AFTER MATCH HOLD OLD-OR-NEW
END
TABLE FILE HOLD
-etc
January 24, 2007, 03:13 PM
FrankDutchok this sounds rather sympel, I will give it try.
thanks for this.
Is there a difference in the result in HOLD OLD-OR-NEW or OLD-AND-NEW?
Well, let me try both options...
January 24, 2007, 03:34 PM
ETYou want to use old-or-new. Old-and-new is like an inner join and you would get only those that are on all 3 files.
January 30, 2007, 02:34 PM
FrankDutchthanks for the supprt, it works well and it is in many cases a better way to combine data then the join function.