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



On 3/15/2012 1:58 PM, Schmidtberger, Gregory P wrote:
I have several modules compiled into a service program. They each
control inserts/updates/and deletes to specific tables. And all these
modules export a data structure with exactly the same name. Because
they all export a data structure with the same name I have compiled
the service program with *DUPVAR. ...
... I would like to keep a single name for the exported
data structure so that my upstream programs can always count on
importing a single data structure. Does anyone know if what I'm
attempting to do should work or not? Or is the fact that all the
modules exporting the same data structure name is causing a problem?


That won't work.

The "Duplicate Symbols" section of ILE Concepts describes the concept of "weak exports" and "strong exports". With weak exports, all the exports use the same storage. With strong exports, all the exports are unique.

RPG only supports strong exports, so only one of the data structures will actually be exported from the service program (the binder listing from CRTSRVPGM. The data structures from each of the other modules will not be available outside the module.

One way to do this would be to have one more module that only exports the data structure, big enough for all the other ones. Then all the other modules would import the data structure, defining their data structure with the size of the exported one, but with the fields required by that module.

While the scheme I have described should work technically, I don't think it's a good idea to use import/export in this way.

Instead of using import/export, I think you'll find it better in the long run to use a more direct way of communicating, using procedures.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.