You may want to check the manuals to make sure but I don't think the date format you're using supports dates outside of the two digit year date window (it's Jan 1, 1940 until Dec 31, 2039 currently). ISO format does support much older dates as well as dates far into the future (Dec 31, 9999 - watch out for the Y10K bug!). If you use format *ISO0 instead of *CYMD0, you should be set.
Matt
________________________________________
From: rpg400-l-bounces@xxxxxxxxxxxx [rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Chandana Silva [chandana.silva@xxxxxxxxxxxxx]
Sent: Wednesday, January 16, 2008 11:06 PM
To: RPG programming on the AS400 / iSeries
Subject: Date Format prior to 1940
We are on V5R4 and I am not sure, if this is a PTF issue.
I searched the net but couldn't come closer.
Here is the code:
D Date5 S D INZ(D'1939-06-01')
D Date8 S 8 0 INZ(20080101)
Date8 = %Uns(%char(Date5:*CYMD0))
DATE8 = 00390601
Per IBM I have to use the 3 Digit format for this but result is not good for a 8 digit field but good for 6 digit.
My objective is to get the DATE8 = 19390601 in the simplest Date format.
Any suggestions would be greatly appreciated.
--
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.