Hi Paul,
It seems to me to be a bug in the SQL precompiler.
I just tried it out our system with release V5R4 (and current PTF level).
If a date field is specified in either an array data structure or a MODS
that is used in a multiple row fetch, the compilation fails and SQL5011 is
returned.
If a date field is specified in a simple data structure, that is used in a
single row fetch the program will be compiled.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Paul Tuohy
Gesendet: Saturday, January 19, 2008 13:14
An: 'RPG programming on the AS400 / iSeries'
Betreff: Embedded SQL date in DS array problem
Hi All,
I am having a problem with date defined fields in a DS. In this example the
column NEWSDATE is defined (using DDL) as a date field. When I compile the
program below I get the message "SQL5011 30 22 Position 54 Host
structure array MYDS not defined or not usable."
Both date fields are *ISO.
If I get rid of the date field, all works fine.
If I define MyDate as character and use CHAR(NewsDate), all is fine.
I am at V5R3 - any idea what is going on?
D MyDS Ds Qualified
D Dim(10)
D MyDate d
D DaySeq 5 0
/Free
Exec SQL
Set Option Naming = *SYS,
DatFmt = *ISO;
Exec SQL
Declare C1 Cursor For
Select NewsDate, DaySeq from NewsItem
Where DaySeq = 5
for read only;
Exec SQL
Open C1;
Exec SQL
Fetch C1 for 10 rows into :MyDs ;
Exec SQL
Close C1;
*InLR = *On;
/End-Free
Regards
Paul Tuohy
ComCon
<
http://www.comconadvisor.com> www.comconadvisor.com
<
http://www.systemideveloper.com> www.systemideveloper.com
As an Amazon Associate we earn from qualifying purchases.