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
7499 D SQL_00020 141 148D DATFMT(*ISO) CURRENTBYDATE
*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
Here is line 15278:
15278 C EVAL CURRENTBYDATE = SQL_00020 SQL 04
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
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.
STAR BASE Consulting, Inc.