The example given, which has a *MDY as input, doesn't seem to match the question, but I think we all get the idea. My issue with it is that date conversions are much more expensive than the simple data structure with numeric EVALs provided by the OP. The other caveat is that the date operations would need a MONITOR if there's any chance of there being a bad date in the input. For converting between formats, the date conversion version is solid and easily understood, but for just truncating off the century, I'd be inclined to go with the cheaper arithmetic method. Just my opinion, of course.
Dave Shaw
________________________________
From: Bill Wragg <bill_wragg@xxxxxxxx>
To: 'RPG programming on the IBM i (AS/400 and iSeries)' <rpg400-l@xxxxxxxxxxxx>
Sent: Saturday, August 17, 2013 11:47 AM
Subject: RE: Want to replace MOVE numeric 8 to numeric 6 in free form
I am getting that these are dates:
8,0 is a ccyymmdd
6,0 is a yymmdd
// mmddyy to yymmdd
@numA = %dec(%char(%date(@numD:*mdy):*ymd0):6:0);
Converts numeric ccyymmdd to numeric yymmdd
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.