|
This is an unexpected behavior I found when doing Y2k work. The DATFMT keyword on the HEADER spec controls the format of *DATE. The format it uses is that of the job that's compiling the program, not the job running the program. To work around this, create a field named something like "TODAY" and then initialize that field to *SYS or *JOB. D today S D INZ(*JOB) This gets the job date into a real date field. Bob Cozzi cozzi@rpgiv.com Visit the new on-line iSeries Forums at: http://www.rpgiv.com/forum > -----Original Message----- > From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com] On > Behalf Of Peter.Colpaert@honda-eu.com > Sent: Friday, September 07, 2001 4:54 AM > To: RPG400-L@midrange.com > Subject: Date weirdness in RPGLE > > > > Hi group, > > I have just come across this very strange phenomenon: > > We have a program that contains the following code: > > D IsoDat S D DATFMT(*ISO) > > C Movel *DATE IsoDat > > Now if we run this program on our development machine (V4R3M0) this works > fine, > even though the system value QDATFMT is DMY. > > However, when I run this same program on one of our production machines > (V3R2M0 > - I know, old but no > budget to upgrade) this doesn't work because the system value QDATFMT is DMY. > > If I first move to an *EUR formatted date field and from there to the *ISO > date > field, it works just fine. > > Can anybody explain this? > > Thanks. > > Peter Colpaert > Analyst-Programmer > Honda Europe NV - Belgium > ---------- > A program is a device used to convert data into error messages. > ---------- > > > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l > or email: RPG400-L-request@midrange.com > 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.