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