|
Hmmm... I agree, this does not make sense. However, I would've
expected ALL of your numeric tests to fail.
According to the ILE RPG Reference manual:
If the character or numeric field specified as the field-name operand
is longer than required by the format being tested, only the leftmost
data is used. For example, if the dtz-format operand is *MDY for a test
of a numeric date, only the leftmost 6 digits of the field-name operand
are examined.
If that's true, the leftmost 12 digits of NUM1 are all zeroes, so all
the date tests should fail.
>From the information you're posting, however, it APPEARS that it's
actually checking the RIGHTMOST digits (as if you did a MOVE operation to
the correct size field)
Which, of course, is the opposite of what the documentation says... So
I'm curious as to what the explanation will be! :)
On Tue, 26 Nov 2002, Chris Beck wrote:
> --
> Could someone possibly explain to me why I am getting the results I am from
>the following code:
>
>
> D NUM1 S 20 0 INZ(20011039)
> D CHAR1 S 20 INZ('20011039')
>
>
> TEST(ED) *MDY NUM1; // %ERROR = *OFF - ?? Shouldn't this be *on because
>there is no month 20
> TEST(ED) *YMD NUM1; // %ERROR = *ON - ?? this should be *off, year of 20,
>month 1 day 10
> TEST(ED) *ISO NUM1; // %ERROR = *ON - OK
>
> TEST(ED) *MDY0 CHAR1; // %ERROR = *ON - OK
> TEST(ED) *YMD0 CHAR1; // %ERROR = *OFF - OK
> TEST(ED) *ISO0 CHAR1; // %ERROR = *ON - *OK
>
>
> Thanks,
>
> Chris
>
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.