I am having trouble with code generated by the SQL precompiler. It has to be something I am doing because this used to work, and as far as I know, nothing has changed for a very long time. we are at V5R4. Here is the relavant portion of the compile listing:

7498 D SQL_00019 139 140A F1300I
======> aaaaaaaaaaaaaaa
*RNF0525 20 a 014722 The length must be 10 for date format *ISO-.

Note that this was defined as type D with DATFMT(*ISO), but with only 8 characters. This was generated by the SQL precompiler. the host variable CURRENTBYDATE is defined like so:

66 d currentByDate...
67 d s d

Here is the cross-reference listing for CURRENTBYDATE

CURRENTBYDATE D(10*ISO-) 67D 15278M 15333

Here is the fetch that generated all this:

15264 C*EXEC SQL
15265 C* FETCH FROM C1 INTO :F13004 ,:F13001 ,:F1300I
15266 C* ,:currentByDate ,:currentStartTime ,:currentByTime
15267 C* ,:F1300B ,:F13003 ,:F13005 ,:F1300A ,:F13009
15268 C* ,:F1300G ,:F13002 ,:F1300M ,:F1300L ,:F1300K
15269 C*END-EXEC

Here is line 15278:


Here is line 15333:

15332 C eval F1300C 04
15333 C = %dec(%char(currentByDate:*ISO0):8:0) 04

The SQL Options are set using:

15065 C*exec SQL
15066 C* set option
15067 C* datfmt = *ISO
15068 C*end-exec

This is the first EXEC SQL in the program, I checked that.
This has to be a configuration issue or something like that (I Believe) because nothing that I know of has changed for a very long time, and this used to compile properly. Does anypone have any ideas on what might coerce the pre-compiler (RPG 4 SQL precompiler) to define this date field properly? Charles, this is one of those Plex SQL programs.

Mark Murphy
STAR BASE Consulting, Inc.

Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2015 by MIDRANGE dot 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 here. If you have questions about this, please contact