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




On 30/09/2008, at 8:41 AM, donna lester wrote:

Below is my code. I am trying to replace copy commands program by writing RPGLE.
Is this a good design , will this run faster? I would like to know your opinions and suggestions.
Thank you for your time. The number of records in AFILE usually more than a million.

It's not a question of how many records are in the file but rather how many match the selection criteria.

CPYF FROMFILE(*LIBL/ABC.FILE) +
TOFILE(*LIBL/XYZ.MONY) MBROPT(*ADD) +
INCREL((*IF MID *EQ &YID) (*AND +
MNAME *EQ &YNAME) (*AND MACCT *EQ &YACCT))


You are using INCREL so no keyed processing. Specify FROMRCD(1) to force arrival sequence processing. That will allow record blocking. I think that is still effective even with INCREL.

If the number of records selected for processing is a small subset of the total file you may find that using FROMKEY and TOKEY will improve performance.

You won't know for certain whether CPYF in arrival sequence, or CPYF in keyed sequence, or RPG is faster without performing a proper test. My question is: If the CPYF method is fast enough why are you bothering about it?

MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))

And fix this rubbish too. See the archives for the correct way to handle expected error messages in CL.


Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.