|
But more importantly, please expand on your last comment. Can't a date be passed as a parameter? Why does one need a DATFMT for that?
Bob Cozzi wrote:
In database if you use DATFMT you get that result in your queries and SQL. In RPG IV, everything is pretty much converted to *ISO format when its brought into the program. In RPG IV, you can declare a field as any date format you want to have default conversion to that format when moving it to a non-date field. Today, except for passing parameters, it is true that the usability of the DATFMT keyword in defining date fields is nearly worthless. -Bob Cozzi www.i5PodCast.com Ask your manager to watch i5 TV -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Booth Martin Sent: Thursday, February 08, 2007 12:50 PM To: RPG programming on the AS400 / iSeries Subject: Re: Date conversion technique, alpha to NumericYes, except for the part about defining the file's field as a date type with a DATFMT. Why would anyone do that? That seems to me to be degrading the appeal of a date field.Joe Pluta wrote:From: Booth Martin Then I misunderstood this sentence: "it's a conversion from the file's *MDY format to your *ISO program format."When the file is read in from the database, the buffer that is passed to the caller has a date field in it. That date field is formatted in the manner specified by the DATFMT keyword on the field definition. However, if you then specify an I-spec for that field with a DIFFERENT format, RPG will then convert the buffer data (which is itself a conversion from the 4-byte internal format) into the format you specified. Make sense? Joe
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.