× 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.



Lim,

I'm sure the chain is part of the problem.  But I think that perhaps a
bigger one is the fact that you are reading the input file by key now.  I'm
guessing that a lot more pages have to be swapped into and out of memory,
then back again.  

You might want to try a couple of more tests:
1) Read input sequentially and do the chain + update/write
2) Read input by key and just write

Assuming the input file is the problem, can you go back to reading
sequentially?  If you're reading every single record by key, seems likely
you could just read sequentially.

Other possible solutions:
1) RGZPFM on the input file using the KEYFILE(xxxxxx) parm.  (May take more
time than it saves)
2) Try embedded SQL using a multi-row fetch.  Won't perform as well as the
original, but I think better than reading one row at a time by key.
3) Have you looked at the CPYF command using MBROPT(*UPDADD) and the
INCREL(xxxxx) parms?


Finally, if the chain is the problem.  Then I suggest you take Matt's
advice: make sure the output file has a unique key and just do the write.
Have your RPG program handle the duplicate record error by doing a
chain/update.  Since you said only 100 or so records will already be in the
output file the above would be an excellent way of doing it. 

Charles



> -----Original Message-----
> From: Lim Hock-Chai [mailto:Lim.Hock-Chai@xxxxxxxx]
> Sent: Wednesday, April 28, 2004 5:09 PM
> To: rpg400-l@xxxxxxxxxxxx
> Subject: Slow respond time when file change to open with update&Add
> 
> 
> I created a RPG program that reads an input file that 
> contains about 2.5 mil+ records and write them to a output 
> file if they meeting the criteria (about 1.2 mil+ records).
>  
> 1) It took about 35 mins to run when the input file is open 
> as Input only with sequential access (No Key).  The output 
> file is open as output only.
> 2) It took about 70 mins to run when the program is change to 
> open the input file as Input only with key access and the 
> outfile as Update & Add.  The only logic added to the program 
> is it do a chain to outfile, if %found, update, otherwise write.
>  
> I think the increase of processing time on 2 is cause the 
> outfile open as Update&ADD, which cause the program to not do 
> record blocking when write to outfile.
>  
> I got several methods in mind that I can think of that might 
> speed up 2.  However, just wonder if anybody has had the same 
> problem before and know a good method to speed it up.
>  
> thanks
>  
> _______________________________________________
> 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.