|
This sounds WAY like a job for SQL: one INSERT, one UPDATE, although I
can't quite figure out the syntax of the UPDATE statement. It should be
something like this, although IANASE (I Am Not An SQL Expert):
Update File2
SET File2.FieldA = File1.FieldA,
File2.FieldB = File1.FieldB,
File2.FieldC = File1.FieldC,
File2.FieldD = File1.FieldD,
File2.FieldE = File1.FieldE
FROM
File1
WHERE
File1.KeyField = File2.KeyField AND
(File1.FieldA <> File2.FieldA OR
File1.FieldB <> File2.FieldB OR
File1.FieldC <> File2.FieldC OR
File1.FieldD <> File2.FieldD OR
File1.FieldE <> File2.FieldE)
On the other hand, matching records would work quite nicely as well.
Joe
> From: James R. Newman, CDP
>
> I've got a 9406-600 running V5R2 and have to run a large update job
about
> once a month. File1 is a sequential, non-keyed PF containing about 18
> million records of updated "current" information. File2 is a keyed PF
> "master" with 18 million+ records that will be updated from File1.
File2
> has 1 logical. I'm reading a record in File1 and chaining to File2.
If
> no
> record is found, it writes to File2. If record is found, it then
checks
> about 5 fields and if the fields are identical in both records, no
update
> is
> performed. If they're not the same, the info from File2 is moved and
> written to File1.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.