|
Douglas,
I'm not sure what you feel the issue is with using MOVE, I just ran a test
program and here are the results:
H DFTACTGRP(*NO)
H BNDDIR('XTOOLS/XTOOLS') OPTION(*NODEBUGIO:*SRCSTMT)
H ACTGRP(*NEW)
/copy xtools/qcpysrc,dates
/copy xtools/qcpysrc,utils
D SysDate S D Inz(*SYS)
D date6m s 6S 0
D date6x s 6S 0
C *MDY MOVE SysDate date6M
C eval date6x = DateToDec(SysDate:'*MDY')
C callp WrtJoblog('MOVE=%s xTools=%s':%char(date6m):
C %char(date6x))
C eval *INLR = *ON
****************** End of source ********************************************
Output:
> call testdt
MOVE=41406 xTools=41406
Obviously the results are identical.
A Zoned(6,0) ends up with the system date in it.
Using xTools or the MOVE opcode, you end up with the same results.
(FYI, I did the xTools function because I wanted something in free format that
would world consistently on V5R1 and later without all the nested/nested/nested
built-ins.)
-Bob Cozzi
www.RPGxTools.com
RPG xTools - Enjoy programming again.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of Douglas W. Palme
Sent: Friday, April 14, 2006 8:10 AM
To: RPG Group
Subject: converting system date to integer
I am in need of converting a system date to a six digit numeric....
So if the system date is say 04/14/06 I need to convert it to a 041406
numeric type...
I thought about doing it by using a move statement with *MDY in factor one
but I don't believe that will work as I would have to use 10 digits for the
date.
the problem is we have some display files that there is not enough room to
allow for a four digit year and I am not prepared at this time to re-write
the entire file.
Suggestions or hints?
If you bought it, it was hauled by a truck - somewhere, sometime.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.