× 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.




On Tue, 29 Jan 2013, at 13:12:58, John Yeung <gallium.arsenide@xxxxxxxxx> wrote:

On Tue, Jan 29, 2013 at 11:40 AM, Steve Richter
<stephenrichter@xxxxxxxxx> wrote:
I saw that Luis. But 10/1/2012 converts correctly when it is in a
character field. But not when in a varying field. I do not know if that is
a feature or a bug.

For me, on V5R4, it seems that when using a varying field, it works if
I use the leading zeros, but doesn't work if I don't. When using a
fixed-length field, it works whether I use leading zeros or not.

I would definitely call this a bug. Personally, I think being able to
accept month and day with or without leading zero is the way it
*should* work, but the documentation says the zeros are required, so
the prudent thing to do is operate under the assumption that the zeros
are required.

I don't think that the leading zero has anything to do with it as such - rather it is the effect that that has on the field length.

A *USA date in character form is defined by RPG as being 10 characters long. When it is in a fixed length field its length will correctly report as 8. Test the varying length field (sans zero) and it will report a length of 9. I suspect at that point that RPG simply says "That can't possibly be valid" and gives up.

If this is the case then adding the line: %len(varfieldname) = 10 immediately prior to the %date operation might fix it.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.