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



Hello Mark,

You wrote:
> SQL5011  30      97  Position 44 Host structure array DSDATA not defined
>                       or not usable.

This is wierd.  I played with your code and found the same as you.  Without
the last two procedures it compiles OK.  Actually, the problem procedure is
dltInvGlmF -- without that one it compiles OK.  I compiled different
versions of the source removing a different procedure until I had
successful compiles.

If you specify OUTPUT(*PRINT) when compiling the SQL program you will see
that SQL does find the definition of DSDATA so that means the problem is
that DSDATA is unusable -- presuming the error message is accurate.

OK, lets make that presumption.  What is it about dltInvGlmF that makes it
different?  By a process of elimination I discovered that the dltInvGLmF
procedure will compile if the getAllInvGlmF procedure is removed thus we
learn that there is contention between getAllInvGlmF and dltInvGlmF.

So, what is common to these procedures?  Following the rules of RPG IV we
find nothing is common.  However, we are dealing with the retarded SQL
precompiler here so what would it consider common?  Since we have
previously learned that the SQL precompiler does not understand local
variables we can surmise that the local procedure variables declared on the
PI for dltInvGlmF (tcode, comno, and itcls) are clashing with the subfields
of the same name in the DSDATA data structure.

Changing the names of the parameters defined on the dltInvGlmF PI, or
adding a prefix to the definition of DSDATA will solve the problem.  You
could also put each SQL procedure in a separate compilation unit (or at
least the two that clash) and bind the resulting modules together.

Another problem solved ... damn, I'm good!

Forcing programmers to perform these sorts of contortions in order to use
both SQL and RPG IV is insane.  The sooner Toronto and Rochester replace
the SQL precompiler the better.  The more I use it the less impressed I am.
It's very close to the worst piece of software to come out of IBM -- the
worst being PROFS, blech!

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists
   http://www.flybynight.com.au/

   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175   mailto: shc@flybynight.com.au   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



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.