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



Brian,

Apparently you are trying to prevent unnecessary IO by comparing your
parameter to arnrmb. Is arnrmb a globally defined field? Possibly a data
base field? Then you should be alright, assuming there are no other
procedures chaining the same file.

Better to use a local (static) variable to remember the parameter:

D InStyleSav s like(InStyle) static
D OutMaat s 3

* Only chain record if not already active (Reduces Disk I/O)
C if InStyle <> InStyleSav
C eval InStyleSav = InStyle
C eval OutMaat = *Blanks
C InStyle chain(n) coarmbl0
C if %found(coarmbl0)
C eval OutMaat = maatmb
C endif
C endif

Joep Beckeringh

rpg400-l-bounces@xxxxxxxxxxxx wrote on 23-04-2009 15:57:33:

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

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.