× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Rick.Chevalier wrote on Thursday, April 15, 2010 08:24:

The issue was that the date in the table was a date data type in
*ISO format. The embedded SQL was using the date format for the
job when it retrieved the records which was *MDY. The result was
placing mm/dd/yy into a date expecting to receive yyyy/mm/dd.
Adding the DATFMT(*ISO) option to my SET statement corrected the
issue.

As I'm typing this I'm wondering why it matters. If the date in
the table is a date data type and the field in the result set is
a date data type why would the representations matter? Maybe it
really is a bug? Or, is the value SQL places into the result set
the same representation it would use if displaying on the screen?

Hmmm... tax day post. No wonder I did not get back to this ;-)

I agree it should not matter if the "date data type" of RPG is used for target of the "database SQL DATE data type". The reason I asked about what shows in the listing, is that the SQL precompiler decides what to generate for the data type of the variables. The original information showed a LIKE(aDateDBfield) for the declare of the RPG variable, but if the SQL decided to generate a CHAR(8) or CHAR(10), then I expect that the result would be the same as for the CHAR(date-expression, LOCAL) for which the DATFMT() of the *JOB is used to cast the date to a CHAR value represented by the date format attribute; e.g. *MDY. That is, if the SQL decided to use CHAR versus DATE, then the date format matters. If the SQL honored the attempt to use the RPG Date data typed variable, then the date format should be moot.


CRPence wrote on Wednesday, April 14, 2010 14:20:

What does DATFMT() show in PRTSQLINF? How is the variable
ReceivedBack declared according to the listing? Does the
returned data match the expected format; i.e. the SQL date
format? If the LIKE declared variable appears other than as
DATE(10), what if the variable is declared instead, explicitly
as an alphanumeric with a length of 10 bytes?


Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.