|
I have been asked to create a program for a client that is based on one of their existing programs that has been running in production since 1998. I have been given the source for their original modules, display files, etc which I have compiled on my system without any problems. However, when I call the program and after working through a couple of screens one of the modules falls over with the following error: Program Status . . . . . . . . . . . . : 00114 The year portion of a Date or Timestamp value is not in the correct range (C G D F). Previous Status . . . . . . . . . . . : 00000 Statement in Error . . . . . . . . . . : 00001686 The module is an SQLRPGLE type and working through the compiler listing I find that the statement causing the error is: 1686 C EVAL SQL_00049 = @@DAT01F SQL The original SQL line, part of a cursor declaration, that uses field @@DAT01T is: 1629 C* l050RLSD >= :@@DAT01F and l050RLSD <= :@@DAT01T and When I check the field usage section at the end of the compiler listing I find that all three of the fields mentioned in the SQL statement are all defined as 10 character dates in the ISO format, but the SQL_00049 field is defined as 8 characters with a DMY/ format: @@DAT01F D(10*ISO-) 106D 1425M 1442M 1686 @@DAT01T D(10*ISO-) 107D 1426M 1452M 1687 *RNF7031 L050RLSD D(10*ISO-) 68D 1026M SQL_00049 D(8*DMY/) 468D 1686M I have two questions. First of all why would the SQL pre-compiler define the SQL_00049 differently to the field it is supposed to represent? Secondly, I always thought the true benefit of the date type field was that you could move them from format to format and the system would automatically convert them for you. If that's not the case, why hasn't the error occurred before on the client's system? Thanks Jonathan
As an Amazon Associate we earn from qualifying purchases.
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.