× 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 just wanted to add a little bit to this in case I ever forget how I solved this again, and for those who might be interested.

I had a repeat of this issue after changing some things in the code and /finally/ resolved it again, this time taking note of the solution.

After eliminating other errors related to RPG syntax, the solution to the particular SQL5011 error was to change the code to do a one-row fetch, and this time the "reason" was date incompatibility. So using CTL-OPT  DATFMT(*ISO-) in the RPG headers, and the SQL Option  DatFmt = *ISO- both, got it through. Duh.

--Alan


On 5/26/2021 11:19 AM, Alan Cassidy wrote:
Thanks to everybody.. Issue resolved, it was an RPG definition issue. Somehow the pre-compiler seems to have been confused by other definitions proximate to the dcl-ds MT LikeRec(CS15R). Or something.

The RPGPPOPT(*LVL2) got me thinking of using the precompiler RPG output to compile, and I was able to eliminate the errors in the SQLRPGLE, and finally did get a clean compile. Duh.

I did of course see the reason text in the SQL5011 error, but "host variable must have a member" didn't seem clear enough to me. The fog of years maybe.

--Alan


I tried the

On 5/26/2021 11:01 AM, Vern Hamberg wrote:
Alan

The fancier SQL5011 came out in fairly recent releases - I don't remember if the text you saw is the old or the new.

Regards
Vern

On 5/26/2021 6:58 AM, Alan Cassidy wrote:
Justin,

I appreciate your reply. I tried compiling with the RPGPPOPT(*LVL2) and got the same message with the same reason text. And the reference page at IBM for the error says this is the modified SQL5011 with the clarification of a reason..

--Alan



On 5/25/2021 2:11 PM, Justin Taylor wrote:
I'd guess the precompiler doesn't see the LikeRec().  I always compile
SQLRPGLE with the RPGPPOPT(*LVL2) parameter, because it often helps in
situations like this.

HTH


date: Tue, 25 May 2021 09:34:05 -0400
from: Alan Cassidy <cfuture@xxxxxxxxxxx>
subject: Fwd: sql5011 error

See below the SQL precompiler errors I'm getting. The SQL5011 is the
most obstinate for figuring out.

I searched the archives and it was not specific enough to the reason
text or my situation.

My best guess WAS an incompatibility between RPG and DDS date types and
SQL date types, because there are about five DDS fields defined as
having DATE type.

A couple of those dates have almost all default dates (0001-01-01). I
may list out only the fields that are actually used in the program, but
I'd first like to have a better idea about this. One of the issues in
the archives I saw noted that the pre-compiler pointed the finger at the
first subfield brought in from the file).

--Alan


dcl-DS MT LikeRec( CS15R) DIM( 500 ) ;
.? . .

  ?1080????????? exec sql SET OPTION DATFMT = *ISO ;
  ?1081????????? exec sql SET OPTION CLOSQLCSR = *ENDMOD ;
  ?1082????????? exec sql SET OPTION COMMIT = *NONE ;
  ?3692?? c024??? exec sql Fetch next from CK for :Rows_to_fetch rows
into :MT ;
  ?3709?? c024?????? exec sql Fetch next from CK for :Rows_to_fetch rows
into :MT ;

DIAGNOSTIC MESSAGES
SG ID? SEV? RECORD TEXT
SQL5066?? 0??? 1080? Precompile option DATFMT changed by SET OPTION
statement.
SQL5066?? 0??? 1081? Precompile option CLOSQLCSR changed by SET OPTION
statement.
SQL5066?? 0??? 1082? Precompile option COMMIT changed by SET OPTION
statement.
SQL5011? 30??? 3692? Position 67 Host structure array MT not defined or not
  ??????????????????? usable. Reason: The host variable is not defined or is
  ??????????????????? not a valid structure. A valid host structure must
have
  ??????????????????? at least one valid member.
SQL5011? 30??? 3709? Position 70 Host structure array MT not defined or not
  ??????????????????? usable. Reason: The host variable is not defined or is
  ??????????????????? not a valid structure. A valid host structure must
have
  ??????????????????? at least one valid member.
SQL0104? 30??? 3709? Position 72 Token ( was not valid. Valid tokens:
<END-OF-STATEMENT>.
  ?????????????????? Message Summary






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.