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



Whether in a subprocedure or a subroutine, if I anticipate the successive chains *may* occur (and I don't really need to get the same record again, I simply check the field(s) to use on the CHAIN to the previous CHAIN's key field(s). Naturally, you have to save the key field(s) and test, but that's considerably faster than a disk I/O.

Jerry C. Adams
IBM System i Programmer/Analyst
--
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Johnson, Brian (EU)
Sent: Thursday, April 23, 2009 8:58 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Externalizing Data Access - Reducing Disk I/O

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



This message and any attached documents contain information which may be confidential, legally protected or exempt from disclosure under applicable law. These materials are intended only for the use of the intended recipient. If you are not the intended recipient of this transmission you are hereby notified that any use, distribution, disclosure, printing, copying, storage, modification or the taking of any action in reliance upon this transmission is strictly prohibited. If you have received this communication in error, please immediately notify the sender and delete the message from your system and destroy any print-outs and copies. Polo Ralph Lauren reserves the right to record and monitor email communications through its networks for the purposes of eliminating potential viruses, blocking unsolicited emails, filtering out illegal or offensive content, and for investigating and detecting any unauthorized use of its systems as well as ensuring its effective operation. The!
content of this email is not legally binding unless explicitly confirmed by letter. Please note that it is your responsibility to scan this message for viruses.

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.