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



Charles,

Thanks for the reply. The answer to your question is no, I just need to get at the data via item number or OPC code. As far as ILE goes, I have no issues with using it, I just don't understand it enough to use it...yet. It's not clear to me how to "exit" to a service program and return the entire record from a file (per haps that's not what one does). Is this done with a data structure or with some kind of global variable?

Kelley

----- Original Message -----
From: "Wilt, Charles" <WiltC@xxxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Wednesday, December 12, 2007 7:12 AM
Subject: RE: A Question Of Technique


Kelly,

I suppose one big question is, do you need to keep the records accessed via each path separate?

Is so, the rename of the records format + prefix is a good choice. You could also take advantage of
RPG's ability to read and write directly to a data structure.

Normally, however program like you describe are only concerned with one record at a time and don't
care which access path is used to get it. In that case renaming the record format is all you really
need to do. You want the files to share the same buffer, so leave the field names the same. Also,
you could also use the read/write directly to a DS here to.

You say you don't use ILE, which is too bad. Because this is an excellent example of where ILE can
benefit you; instead of having the multi access path logic duplicated in every program. You could
have it in only a single ILE service program.

The service program could have procedures like:
GetItemByItemNumber()
GetItemByItemSubKey1()
GetItemByItemSubKey2()

Though I'd hope you'd give them meaningful names by replacing SubKeyX by whatever that key means to
you.

Possibly an even better way may be to consolidate into a single GetItem() procedure, that takes too
parameters. The first is a "KeyType" and the second is the key. The disadvantage is that such a
procedure is a little harder to use, but the advantage is that you reduce the logic in the calling
programs and make it easier to add new ways to lookup the item to existing programs.

In fact, by softcoding the valid "key types" you could add new lookup methods to your programs without
having to recompile them. Only the service program would need updating.


HTH,
Charles



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.