|
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Kelley
Sent: Wednesday, December 12, 2007 9:13 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: A Question Of Technique
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,excellent
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
example of where ILE canGetItem()
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
procedure, that takes tooreduce
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
the logic in the callingexisting
programs and make it easier to add new ways to lookup the item to
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
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
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.