|
At least it gave him a message. I seen BPCS programs compile OK with bad SQL Statements and the drop RPG code out that was bellow it. Program runs and you wonder why things just did not happen. Look at the RPG code it's there; look at the RPG compile it's gone. Go figure. Bill H. -----Original Message----- From: Simon Coulter [mailto:shc@flybynight.com.au] Sent: Wednesday, September 11, 2002 2:09 AM To: rpg400-l@midrange.com Subject: Re: SQL Problem 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 / \ -------------------------------------------------------------------- _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com 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.