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




I am trying to compile an RPG program that contains the sub-
procedure shown below and am getting an SQL0314 error saying that
host variable OBATCH is not unique. Originally the variable was
called wBatch which was also defined globally, so despite the v7r2
SQL manual saying that the pre-compiler copes with the different
variable scopes correctly I changed the name to be on the safe side.
However, no matter what I change the name to I always get the SQL0314
error.

If I move the declaration to the mainline code and make the scope
global then the pre-compiler is happy and no error is generated. It
seems to me that if I have to declare the variable globally then I
may as well either use a subroutine instead of a sub-procedure or
change the sub-procedure to use native I/O instead. I have checked
with our technical support guys and they have confirmed that we are
7.2 with cume 115310 and latest group and HIPER PTF's applied.

Any ideas/suggestions would be most welcome.

Thanks
Jonathan
I use SQL often in subprocedures. I just did a test where I declared a
variable as you have, and used a select into type of statement. I copied
this to another subprocedure and it compiled. I changed the definition in
one of the subprocedures, so that they would conflict if global, and it
still compiled. When I've seen the error you have, its usually something
unrelated to that variable, but I can't see anything wrong with your
snippet, so I'm at a loss. What I've done for this before, was to make the
compiler happy however I could, and then the error shows itself as a
runtime issue, or a different compile error.



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.