|
Please respond to RPG programming on the IBM i / System i
We're developing some RPG modules (bundled into a service program) that
have externalized access to some data files. Due to some of the data
layout, I have a concern of excessive data I/O.
We have a procedure that returns the size array attribute for an
article. The code itself works great. My concern is where we
repeatedly call the procedure with the same incoming parameter, and the
procedure constantly chains the same record over and over again. My
hope (and coding) was that the subprocedure retained knowledge of
existing record in memory, and prevent the additional chain, but that
doesn't appear to be the case.
Is there anything else I can do to reduce unneeded disk I/O?
Thanks,
Brian
Example:
(INVOKES EXPORTED PROCEDURE)
C eval TmpSizeA =
GetStyleSizeA(%subst(InArt:1:8))
****************************
* Procedure - GetStyleSizeA
****************************
* Returns Style Size Array Code
P GetStyleSizeA b export
* Input Parameters
D GetStyleSizeA pi 3
D InStyle 11 const
D OutMaat s 3
* Only chain record if not already active (Reduces Disk I/O)
C if arnrmb <> InStyle
C eval OutMaat = *Blanks
C InStyle chain(n) coarmbl0
C if %found(coarmbl0)
C eval OutMaat = maatmb
C endif
C endif
* Return size array code
C return OutMaat
P e
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.