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



No, the human readable is not stored in the DB. ( except in the case of the program describe file.
RPG handles dates as 10 character fields. You can see this in procedure calls with date parameters.)

Remember, i5 OS is object based, and what are a couple key points about objects? Abstraction and
information hiding; thus, the input/output to/from the DB for a date field are 10-char. But
internally, the data is converted and stored as an integer.

DSPFFD isn't really lying. From outside the object, 10-char is the format you see for I/O.

The only way to really see the internal format would be DMPOBJ.

HTH,
Charles


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Dave Kahn
Sent: Wednesday, December 19, 2007 6:42 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: To Date or Not to Date... that is the question

On 18/12/2007, CRPence <crp@xxxxxxxxxxxxxxxxxxxx> wrote:
DSPFFD does indeed effectively lie for the length of data types Date,
Time, and TimeStamp. The /buffer length/ is accurate for the specific
[human-readable] formatting for presentation, not the length for the
internal storage for the data type; as seen for Packed and Integer for
example.

But what about the storage in the physical record? I create a database
file with a date field DSPFFD tells me the field occupies 10 bytes. If
I populate the database file and display it with DSPPFM I see a 10
character ISO representation of the date. If I then create a new flat
physical file and copy the database file to it with FMTOPT(*NOCHK) I
see that 10 character format dates are copied to the flat file. There
should have been no under-the-covers conversion in this case.

If I create an RPG program defining my database file as a program
described flat file and use it to read the file I can see that it is
indeed getting 10 character representations of the date in the buffer
position indicated by DSPFFD.

If I use SQL to display my database file the date field is not
displayable unless I use a function such as HEX, CHAR or DAYS to
resolve it.

All the above suggests to me that the physical representation in the
database is not the internal date format but the character
representation and DSPFFD is telling the truth about the buffer. It
appears to me to be the human readable form that gets stored in the
database.

--
Dave...
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




This e-mail transmission contains information that is intended to be confidential and privileged. If you receive this e-mail and you are not a named addressee you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this communication without the consent of the sender and that doing so is prohibited and may be unlawful. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please delete and otherwise erase it and any attachments from your computer system. Your assistance in correcting this error is appreciated.

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.