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



I think I understand but wonder why this didn't happen until I added two
date fields with DATFMT(*ISO) in the DDS. There were already two date
fields with DATFMT(*USA) and I didn't get the SQL0180.
So, if I use the SET OPTION SQL command, all should be well?

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Luis Rodriguez
Sent: Monday, July 09, 2012 2:19 PM
To: Midrange Systems Technical Discussion
Subject: Re: SQL0180 on SQL insert

Thomas,

The program date format is defined by either the COMPILEOPT keyword in the
CRTSQLRPGI command or by the H-SPECS to the same effect. If nothing is
specified it defaults, IIRC, to the job's date format.

The SQL date format is defined, as Rob posted before, using the SET OPTION
sentence.

So, as I see it, the ideal would be for you to define SQL's date format as:
exec sql DATFMT = *ISO;

and RPG's date format as:
H DATFMT(*ISO)

That way you can be assured of your date fields being consistent in their
format.


BTW, internally the actual date data is not defined in any particular
format. It is defined as a 4-byte string containing an integer (a Scaliger
Number) that represents the date. So, if I get your file ("defined" as
*MDY) in my system, I would "see" it as *DMY, just because that is my job's
default date format.

Hope this makes sense....

Regards,



Luis Rodriguez
IBM Certified Systems Expert - eServer i5 iSeries

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.