|
formatting routine? Why bother, when RPG already gives you so many good choices that are as easy as: C *YMD/ move date Date8C (yy/mm/dd) or C *USA/ move date Date10C (mm/dd/yyyy) ? --------------------------------- Booth Martin http://www.martinvt.com --------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: 01/14/05 13:22:15 To: RPG programming on the AS400 / iSeries Subject: RE: Dateformat trouble with time. Hmmm, I know I'm not a walking reference for some reasons. But in this case it would have been better to have a look first in it... Ok the thing that now works for me is: DTODAY S D DATFMT(*ISO) * C TIME TODAY C MOVE TODAY $H08N0 And than I can go on with my formatting routine to make the date presentable Thanks again. This is enough for today..... I go to the beach! Cheers, Eduard. "DeLong, Eric" <EDeLong@xxxxxxxxxxxxxxx> wrote: Yes, that's right. *YMD is a six-digit date format identifier. If you want an eight-digit format, you must use *ISO, *USA, *EUR, or *JIS. See chapter 14 of the ILE RPG reference for details. Eric DeLong Sally Beauty Company MIS-Project Manager (BSG) 940-898-7863 or ext. 1863 -----Original Message----- From: Eduard Sluis [mailto:eduard@xxxxxxxxxxxxxxxxxxxxxxx] Sent: Friday, January 14, 2005 11:32 AM To: RPG programming on the AS400 / iSeries Subject: RE: Dateformat trouble with time. Thanks to all of you. Now I know that I should have expected it. To get to a solution I have played around a bit to find a suitable solution. Changing DATEDIT into DATFMT did not work (the job does what it likes best). So on to the TRUE date/time fields. Much to my surprise I got the next result?? Code: C TIME TODAY C *YMD MOVE TODAY $H08N0 Debug: > EVAL TODAY TODAY = '2005-01-14' > EVAL $H08N0 $H08N0 = 00050114. Interesting? Eduard. Bob Cozzi wrote: You should be storing the date/time in true date/time variables not the old 14-digit zoned numeric fields. That way you don't care what the format is. D Today S D D rightNow S T C TIME Today C Time RightNow Then you can MOVE those values into non-date or non-time fields using the MOVE opcode and thereby specify the resulting formats in Factor 1 of the MOVE. C *YMD MOVE Today H08N0 -Bob Cozzi -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Eduard Sluis Sent: Friday, January 14, 2005 10:20 AM To: RPG400-L Midrange Subject: Dateformat trouble with time. Dear all, Much to my disgust I have encountered the following problem with TIME. In indefinite running batchjobs (servers) we use the TIME to get to the correct date independent of the actual jobdate. We assumed that the format we would get the date part of the time in would comply with the H DATEDIT(*YMD) header specification we use in all our programs. Recently we discovered that this is not the case and the dateformat is in the *SYSVAL format. So when the *SYSVAL is *DMY we get as time: $H14N0 = 17195413012005. When the *SYSVAL is *YMD we get as time : $H14N0 = 11503120050114. Should I have expected this?? Kind regards, Eduard Sluis. -- 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 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 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 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 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. -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 1/12/2005 .
No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 1/12/2005
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.