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.