× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Forget most of my first reply, I read your question to fast.  ;-)

SETLL may still be of use as you could do a SETLL and if %FOUND do a READ
then an UPDATE.

However, one question to ask.  Do you have any expectations of #updates vs.
#writes?  That may make a difference.


Also, do the two files have exactly the same format and when you update do
any of the fields retain their original value?


SQL may still be the fastest way to do this, but lets see what your answers
are first <grin>

Lastly, have you considered alternative methods such as a trigger program
that keeps the output file upto date?


Charles



> -----Original Message-----
> From: CarollaT@xxxxxxxxxxxxxx [mailto:CarollaT@xxxxxxxxxxxxxx]
> Sent: Friday, September 03, 2004 11:16 AM
> To: rpg400-l@xxxxxxxxxxxx
> Subject: CHAIN to a DS
> 
> 
> 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 thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.