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



Thank you, Daniel!

Yes, I finally got a compiler message a few minutes ago that led me to put the quotes around the EXTNAME keyword. Good catch!

A few iterations back of attempts to get the compile, I did take out the *AUTO to try that, yesterday, but that didn't help either. My shop is now at V7R4 and the V7R4 reference includes text about *AUTO. So it's not that either.

Also, with most compile attempts, I have been getting the SQL5011 error, but today it finally referred to an issue with a date or date format incompatibility. I think that's probably the issue with FETCHing the data from the SQL View into the data structure, but then I have used CTL-OPT to set the RPG date format default to *ISO, and I used EXEC SQL SET OPTION to set the SQL date formats to *ISO also.

IF that doesn't do it, my next step after that is going to be to look over all the date-type columns in the SQL View I am using to build the SQL cursor statement. (Which I did some weeks back). Thanks for your help.

--Alan


On 1/21/2023 2:49 AM, Daniel Gross wrote:
Hi Alan,
I could be wrong, shouldn’t the DS definition be like this:
   dcl-ds MX extname('CS58V004') dim(9999) end-ds;
Or is CS58V004 a named constant in your program?
Because I always do forget the quotes around the file name, and I always
get punished by the compiler or pre-compiler for it - but in fact, they
are mandatory.

[1]EXTNAME(file-name{:format-name}{:*ALL|
*INPUT|*OUTPUT|*KEY|*NULL}) [2]apple-touch-icon.png
ibm.com

But I don’t know if the SQL precompiler already understands *AUTO on your
release/TR level - because right now it still has issues when using
LIKEREC(…) with any of the extenders like*ALL, *INPUT, …
The SQL precompiler is maintained by another team, not Barbara’s great RPG
compiler people - so it always „limps“ a bit behind on the language
features.
And all that the precompiler emits in such cases is SQL0314 - so it’s
always a guessing game, what’s really wrong.
HTH
Daniel

Am 20.01.2023 um 22:49 schrieb Alan Cassidy <cfuture@xxxxxxxxxxx>:

|| also this is probably better suited to the RPG list
I agree. I will forward this dialogue there.
Charles,
I put qualified on both of them but it did not help at all. Note that
none of the subfields are explicitly used in this procedure.
Could it be there is a gap in the understanding of the pre-compiler?
--Alan Cassidy
On 1/20/2023 4:42 PM, Charles Wilt wrote:

also this is probably better suited to the RPG list

Charles

On Fri, Jan 20, 2023 at 2:40 PM Alan Cassidy <cfuture@xxxxxxxxxxx>
wrote:

Good call, I'll fix that and let you know!

--Alan

On 1/20/2023 3:36 PM, Charles Wilt wrote:

I suspect your problem is that you have two unqualified DS from
the same

EXTNAME...

The RPG compiler wouldn't like that, let alone the SQL
Pre-Compiler...

I would add QUALIFIED to both.

Charles

On Fri, Jan 20, 2023 at 12:57 PM Alan Cassidy
<cfuture@xxxxxxxxxxx>

wrote:

I have to correct something I said before. I took the *AUTO out
of the

DIM(*AUTO:9999) keyword in the declaration and it still barfed
the same

message. So it has nothing to do with *AUTO.

Also, I have /exactly and precisely/ (redundant for emphasis)
the same

syntax in another regular *PGM program and it has been running
smoothly

for a long time.

What I don't get is how an SQL pre-compiler can get error out on
a

variable definition conflict when there is only one. (for the
SQL

statement variable used to "Prepare" the cursor.

definition conflict  two different definitions for something out
of one

definition.

- Alan

On 1/20/2023 10:39 AM, Alan Cassidy wrote:

Thanks, Charles!

I don't know whether it's relevant at this stage, but this all
happens

in the context of a service program procedure.

*SQL0314 Sev=35 Record=2297 Text = Position 40 Host variable
QQSTMT

not unique.*

*SQL5011 sev=30 Record=2301Text = Position 67 Host structure
array MX

not defined or not usable for reason code 1. *

In the calcs I build a dynamic SQL statement in variable
QQSTMT to use

in the normal SQL cursor.

==>As I wrote this I realized that it might be caused by the
other

error SQL0314.

BIG problem with SQL0314 is that I only find once that QQSTMT
is

defined. I suspect that issue is elsewhere but it gives me no
clue.

*DCL-DS MT EXTNAME(CS58V004) END-DS ;*

**

*DCL-DS MX EXTNAME(CS58V004)DIM(9999) ;*

**

*DCL-S QQSTMT CHAR(4098) ;*

**

*2297 exec SQL Prepare STMT1 from :QQSTMT *

**

*exec SQL Declare M1 cursor for STMT1 ;;*

**

*exec SQL Open M1;*

**

*2301 exec SQL Fetch Next From M1 for :RowsToFetch rows into
:MX ;*

--Alan

P. S.I wrestled with the SQL5011 error before. Reading the
text for

it, looks like 12 different possible causes for it. The last
time it

happened for me I posted a please-help, but other changes in
the code

resolved the issue, and I couldn't figure out which change did
it.

=============================

On 1/19/2023 6:08 PM, Charles Wilt wrote:

Need to see where it's being used

Charles

On Thu, Jan 19, 2023 at 3:03 PM Alan
Cassidy<cfuture@xxxxxxxxxxx>

wrote:

In coding a service procedure as a sort-of I/O server.

I have defined a data structure to receive rows from an
SQL View:

DCL-DS   MX  EXTNAME( MYSQLVIEW )  DIM(*AUTO:9999) ;

..where

This exact syntax works perfectly elsewhere without the
*AUTO.

I'm getting error SQL5011  Host structure array MX not
defined or not

usable for reason code 1.

Reason code 1: Host structure array not defined or is not
a valid

structure. A valid structure must have at least one valid
member....

Can somebody help or point me somewhere. I saw something
similar

before

so I suspect it's not the *AUTO throwing things off.

-Alan Cassidy

--

This is the Midrange Systems Technical Discussion
(MIDRANGE-L)

mailing list

To post a message email:MIDRANGE-L@xxxxxxxxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,

visit:https://lists.midrange.com/mailman/listinfo/midrange-l

or email:MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx

Before posting, please take a moment to review the
archives

athttps://archive.midrange.com/midrange-l.

Please contactsupport@xxxxxxxxxxxxxxxxxxxx  for any
subscription

related

questions.

--

This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing

list

To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,

visit: https://lists.midrange.com/mailman/listinfo/midrange-l

or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx

Before posting, please take a moment to review the archives

at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription

related

questions.

--

This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list

To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,

visit: https://lists.midrange.com/mailman/listinfo/midrange-l

or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx

Before posting, please take a moment to review the archives

at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related

questions.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

References

Visible links
1. https://www.ibm.com/docs/en/i/7.5?topic=keywords-extnamefile-nameformat-nameall-inputoutputkeynull
2. https://www.ibm.com/docs/en/i/7.5?topic=keywords-extnamefile-nameformat-nameall-inputoutputkeynull

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.