× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Dave

Your caveat is well=taken. In this case, though, the value in the 8-digit thing is now validated with the test(ed) opcode - at least in one place - have to check!!

Things to think about!

Thanks
V.

On 8/17/2013 11:36 AM, Dave Shaw wrote:
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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.