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



Hi Donna,

Sorry to be a bit late to the game here, but I have a couple of suggestions. I'm no performance guru, so I can't guarantee they'll help much, but I always like more ideas than less in this sort of situation.

First of all, I'd suggest trying out Lim's SQL suggestion. This seems like one of those slam-dunk cases where SQL makes sense, as you are trying to do the same operation on a whole set of records. However, someone (Charles Wilt?) recently posted some performance tests that showed that there is quite a bit more to this than 'SQL should be faster for set-at-a-time than RPG', such as the commitment control settings.

As for RPG suggestions, please see my comments below your code snippet.

donna lester wrote:
* Copy data from ABCFILE by ID, NAME, Acct C k_idnamacc Setll ABCFILE C Read ABCFILE C DoW Not %Eof(ABCFILE) and MID = YID C and MNAME = YNAME and MACCT = YAcct C Write XYZMNYREC C Read ABCFILE C EndDo

I doubt it would make a difference to performance, but do you have a particular reason not to use READE here instead of putting the 'MID = YID AND ...' part in the if condition?

Using data structures for your I/O might improve performance further depending on the number of fields in your file. You would set up something like:


D recordToCopy...
D E DS extName(ABCFILE : *INPUT)
D qualified

D recordToWrite...
D E DS extName(ABCFILE : *OUTPUT)
D qualified

/free
setLL k_idnamacc ABCFILE;
readE k_idnamacc ABCFILE recordToCopy;

doW (not %eof(ABCFILE);
recordToWrite = recordToCopy;
write XYZMNYREC;
readE k_idnamacc ABCFILE recordToCopy;

endDo;
/end-free

Now that I think about it, the extra copy "recordToWrite = recordToCopy;" might undo any gains from using result-DS I/O. I wish there was a way to tell the compiler 'I know what I'm doing, please let me use a based DS on READ* or WRITE'.

Hope that's of some use,
Adam

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.