I have an RPGIV program using dynamically constructed SQL over a file
returning the -183 error code ("Result of date or timestamp expression not
valid") on a FETCH command.  The job log indicates a field in the file being
queried has invalid data in a field that is a DATE data type.  However,
every record in the file contains the value "0001-01-01" in this field,
which is a valid value according to the message text.

The SQL statement being executed successfully is as follows:
 = SUBSTR(MPPVLU,2,4) where MPPGM = 'BNB001C2' and MPCSEQ =
00010 and MPPSEQ = 55 and XTBUSDATE >= DATE('2001-12-01') and
XTBUSDATE <= DATE('2001-12-31') order by

The "DATE" functions were added as a result of something I read in the SQL
programming manual, but didn't change the result.

The FETCH command is as follows:
Fetch From BNBTransWithErrors into :BNBXTTPDS

BNBXTTPDS is an externally described data structure using the BNBXTTP file
as the format.

I'm wondering if we're missing a PTF here, but I don't know.  We are at
V4R1M0 (yes, I know...)

Any help will be greatly appreciated.

Donald R. Fisher, III
Project Manager
The Roomstore Furniture Company
(804) 784-7600 ext. 2124

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