You can create a job
that contains the Compare Tables transformation. The transformation
generates a variety of output for matched and unmatched records. The
Compare Tables transformation supports either a direct in-memory lookup
(hash object) or a sequential disk-based lookup (DATA step merge).
The hash lookup method offers better performance than the DATA step
merge lookup method, but it requires that the entire cross-reference
table fit into system memory. If sufficient system memory is not available,
the DATA step merge lookup method can be used instead.
Perform the following
tasks:
You could use Compare
Tables to update the tables as follows:
-
New PRICE_COST records
are added to PRICE_COST_HIST.
-
Any updates to UNIT_PRICE
or UNIT_COST for a PRICE_COST record cause the current historical
record to be logically deleted and the updated record is added.
-
Records that now longer
appear on the current PRICE_COST table are logically deleted from
the PRICE_COST_HIST table.
-
All logically deleted
records are available for query or reactivation, because they are
retained in the table but are marked as deleted.
The transformation can
handle new records, changed records, missing records, and unchanged
records as output. You can choose to retain or delete any of the possible
outputs as needed to increase efficiency. The transformation also
generates its results in a single pass of the data.