|
Would CPYF FROMFILE(FILE1) TOFILE(FILE2) MBROPT(*UPDADD) work for you?
CarollaT@xxxxxxxxxxxxxx wrote:
I have written some code that takes records in a temp file, and either
updates or adds them to another file. It's the same old, "If the record
exists, update, else write" scenario. The top factor for this little module
is speed - We want this thing to scream, so I am trying to cut every corner
I can, then I will document the you-know-what out of it later.
Basically, I have the output/update file prefixed with a 'D', and I read the
input record, attempt a chain to the output/update file, and move the fields
(450+) from the input file to the output file (in case the chain found a
record), and conditionally write or updated, based on %FOUND.
So I am thinking about this, and I know that you can CHAIN, and read the
resulting record into a data structure. What I am wondering is, since both
files have the same format, and field names, can I CHAIN to the
output/update file, but read the record in to a DS, and _not_ udpate the
fields in the record format. Does every successful chain have to send the
fields to the input record fields? If not, then I would attempt the chain,
and skip moving the 450+ fields to the output buffer, with the prefix.
Thanks in advance for your help.
Tony Carolla
MedAmerica Billing Services, Inc.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.