|
<snip> I think the notion was to follow the behavior of numerics (i.e. all database numeric field types end up as packed unless you explicitly control them) - the problem is that most RPGers don't understand the rules for numerics (as is often made obvious during discussions here regarding prototyped numeric fields) so making dates follow similar rules turns out to be not such a good idea! </snip> I agree... Thanks, Tommy Holden -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris Sent: Monday, October 10, 2005 3:00 PM To: rpg400-l@xxxxxxxxxxxx Subject: RE: Date question >> I believe IIRC the date is actually stored as 4 byte binary... On the DASD - Yes. Other than in a dump of the DASD you will never see it in this format however. As the record is read by the OS the value is converted to the appropriate character string as specified on the type L field in the file (*ISO) if nothing specified. So as far as your program is concerned it is always a character string complete with separators. DatFmt controls how it normally comes into the RPG program. If no H-spec entry (and the field is not otherwise declared in a DS or whatever) then it will come in as *ISO. Note that that may mean double conversion in cases where a format other than *ISO was specified for the L-type field. I think the notion was to follow the behavior of numerics (i.e. all database numeric field types end up as packed unless you explicitly control them) - the problem is that most RPGers don't understand the rules for numerics (as is often made obvious during discussions here regarding prototyped numeric fields) so making dates follow similar rules turns out to be not such a good idea! Jon Paris Partner400 www.Partner400.com www.RPGWorld.com -- 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.
As an Amazon Associate we earn from qualifying purchases.
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.