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



Then I misunderstood this sentence: "it's a conversion from the file's *MDY format to your *ISO program format."

Bob Cozzi wrote:
Booth,

I don't see where they referred to a 6-digit date anywhere?
IBM stores dates as the "number of days since..." as a unsigned integer.
You and I don't have access to that integer value, nor do the IBM RPG IV
compiler developers.
We and they only see the external form, whatever form it may be. If it is *MDY,
*ISO, or whatever. All are stored identically in the system.
So a date with an external format of *MDY whose value "02/08/07" is stored as
the same value as an *ISO date whose value is "2007-02-08".
-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:12 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Date conversion technique, alpha to Numeric

This blows my mind. You are telling us that IBM, post-Y2K, is using a mmddyy 6 figure date?

Barbara Morris wrote:
Jerry Adams wrote:
My understanding is that the date is stored on disk in a binary format,
and that it retains the same value regardless of the what DATFMT's value
is.  That is, one program would have DATFMT(*ISO) and another program
could have DATFMT(*USA) against the same table and that it is merely the
presentation, say on a report or display, that differs.

The fact that it is stored on disk in binary format is irrelevant for
program access.

>From a programming point of view, a date variable is always formatted. If you do DSPPFM, you will see the date as the program sees it. With
RPG, because of the way I specs work, you can define your internal
program field with any date format you like (say *ISO), but the
_external_ format in the file will always be the same for that
particular date field(say *MDY).  If your internal format is different
from the external format, RPG will do a conversion for you, but it's not
a conversion from a 4-byte binary to your *ISO program format, it's a
conversion from the file's *MDY format to your *ISO program format.

The conversion from 4-byte binary to the file's *MDY format happens
somewhere deep down in the operating system, where the system prepares
the data buffer.




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.