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



Igor.Beslic@xxxxxxxxxxxx wrote:
> 
> I'm experimenting with EXPORTED DataStructures and I found I don't know
> how to properly do that. MODUL A is eporting DS and modul B is importing.
> There are two versions of modul B. One is working as I expected and
> another is working but obviosly DS structure is not resolved during bind
> time... I need opinion about examples listed down:

When you say it's not resolved, do you mean that the CRTPGM is failing,
or that the data structure does not have the correct value in the
importing module?

I'm guessing that you mean it does not have the correct value.  If so,
it is because you didn't define it the same in the importing module as
the exporting module.  You forgot to define the subfields in your first
case.  

> MODUL_B NON WORKING VERSION 
> ...
> D trans           DS                  IMPORT('TRANSAKCIJA')
>  /free
> ...

If you don't define any subfields, the compiler gives this structure a
length of 1, and does not define any subfields for it.

Try this, adding the LIKEDS keyword to define the imported data
structure properly:

     D trans           DS                  IMPORT('TRANSAKCIJA')
     D                                     LIKEDS(transaction)

IMPORT doesn't import the definition of the variable.  It only imports
the name.  The system would not care if you exported 'TRANSAKCIJA' as a
PACKED(5,2) and imported it as an array of CHAR(200) DIM(5000).  So you
have to make sure that the definitions match.  You might consider coding
the definitions in your /COPY file rather than duplicating them in each
source file.  The problems with having more than one definition for an
IMPORT/EXPORT variable are exactly the same as having more than one
definition for a prototypes.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.