From: Doug Miller on
In article <ac1c02d1-64a3-400b-9c9a-63989d519a2b(a)f16g2000yqm.googlegroups.com>, yogi <yogibad(a)gmail.com> wrote:
>Hi All,
> I had a question regarding blanks or SPACES in numeric
>fields.

In the time it took you to post this question and read the responses, you
could have written, compiled, and tested a program that would show you the
answer -- and you'd have learned a lot more from doing so than you will by
reading the responses here. Having said that... here are the answers to your
questions:

>Would SPACES pass the IS NUMERIC test used for checking if the
>value is numeric or not.

No. Performing the IS NUMERIC test on a field that contains spaces will
generate an exception.

>Since SPACES can be compared arithmetically

No, it can't.

>(> SPACES),

That's a lexical comparison, *not* an arithmetic comparison. That simply tests
to see whether a particular byte falls before, or after, space in the
collating sequence.

>I was wondering if it would pass the IS NUMERIC test.

Of course not. SPACE is not a numeric digit. Numeric digits are 0 through 9.
From: Richard on
On Dec 2, 5:24 pm, spamb...(a)milmac.com (Doug Miller) wrote:
> In article <ac1c02d1-64a3-400b-9c9a-63989d519...(a)f16g2000yqm.googlegroups..com>, yogi <yogi...(a)gmail.com> wrote:
>
> >Hi All,
> >            I had a question regarding blanks or SPACES in numeric
> >fields.
>
> In the time it took you to post this question and read the responses, you
> could have written, compiled, and tested a program that would show you the
> answer -- and you'd have learned a lot more from doing so than you will by
> reading the responses here. Having said that... here are the answers to your
> questions:
>
> >Would SPACES pass the IS NUMERIC test used for checking if the
> >value is numeric or not.
>
> No. Performing the IS NUMERIC test on a field that contains spaces will
> generate an exception.

The result of the test will be 'false'. 'Generating an exception'
would rather defeat to purpose of doing the test (which can be to
avoid an exception).

>
> >Since SPACES can be compared arithmetically
>
> No, it can't.
>
> >(> SPACES),
>
> That's a lexical comparison, *not* an arithmetic comparison. That simply tests
> to see whether a particular byte falls before, or after, space in the
> collating sequence.
>
> >I was wondering if it would pass the IS NUMERIC test.
>
> Of course not. SPACE is not a numeric digit. Numeric digits are 0 through 9.

Note, however, that the sign representation may lead to other
characters in the field, usually an 'overpunched' digit on the leading
or trailing character or a + or - if 'sign separate'.

From: Anonymous on
In article <hf4q6j$n1m$4(a)news.eternal-september.org>,
Doug Miller <spambait(a)milmac.com> wrote:

[snip]

>Of course not. SPACE is not a numeric digit. Numeric digits are 0 through 9.

Ow... Mr Miller, it might be best to stay with the question of 'will
(thing) pass an IS NUMERIC test?' and avoid the depths of what constitutes
'numeric digits'. The characters 0 through 9 are, as we all know,
represted in DISPLAY format by the hexadecimal characters X'F0' through
X'F9' (unless one is dealing with ASCII, in which case they are X'C0'
through X'C9') or the binary equivalents 1111 0000 through 1111 1111 (or
ASCII 1100 0000 through 1100 1001).

Now my memory is, admittedly, porous but I recall that IBM mainframe
compilers (IKFCBL00 and IGYCRCTL) will successfully test COMP-3 (packed
decimal format) fields with IS NUMERIC... and as a COMP-3 field, in my
experience, often has its least significant nibble reserved for the
field's sign (usually C for positive, D for negative) then a COMP-3 field
containing X'123D' may pass an IS NUMERIC test while not, by your
standard, containing an numeric digit.

Next week... Are Other Representational Systems Numeric or Not? After
All, This *is* the XXIth Century!

DD

From: Doug Miller on
In article <603d52d3-a595-4e19-a954-154aba429fdd(a)c34g2000yqn.googlegroups.com>, Richard <riplin(a)Azonic.co.nz> wrote:
>On Dec 2, 5:24=A0pm, spamb...(a)milmac.com (Doug Miller) wrote:
>> In article <ac1c02d1-64a3-400b-9c9a-63989d519...(a)f16g2000yqm.googlegroups=
>..com>, yogi <yogi...(a)gmail.com> wrote:
>>
>> >Hi All,
>> > =A0 =A0 =A0 =A0 =A0 =A0I had a question regarding blanks or SPACES in n=
>umeric
>> >fields.
>>
>> In the time it took you to post this question and read the responses, you
>> could have written, compiled, and tested a program that would show you th=
>e
>> answer -- and you'd have learned a lot more from doing so than you will b=
>y
>> reading the responses here. Having said that... here are the answers to y=
>our
>> questions:
>>
>> >Would SPACES pass the IS NUMERIC test used for checking if the
>> >value is numeric or not.
>>
>> No. Performing the IS NUMERIC test on a field that contains spaces will
>> generate an exception.
>
>The result of the test will be 'false'. 'Generating an exception'
>would rather defeat to purpose of doing the test (which can be to
>avoid an exception).

You are of course correct. Serves me right for posting so late at night.
>
>>
>> >Since SPACES can be compared arithmetically
>>
>> No, it can't.
>>
>> >(> SPACES),
>>
>> That's a lexical comparison, *not* an arithmetic comparison. That simply =
>tests
>> to see whether a particular byte falls before, or after, space in the
>> collating sequence.
>>
>> >I was wondering if it would pass the IS NUMERIC test.
>>
>> Of course not. SPACE is not a numeric digit. Numeric digits are 0 through=
> 9.
>
>Note, however, that the sign representation may lead to other
>characters in the field, usually an 'overpunched' digit on the leading
>or trailing character or a + or - if 'sign separate'.
>
From: Doug Miller on
In article <hf5t5t$og3$1(a)reader1.panix.com>, docdwarf(a)panix.com () wrote:
>Now my memory is, admittedly, porous but I recall that IBM mainframe
>compilers (IKFCBL00 and IGYCRCTL) will successfully test COMP-3 (packed
>decimal format) fields with IS NUMERIC... and as a COMP-3 field, in my
>experience, often has its least significant nibble reserved for the
>field's sign (usually C for positive, D for negative) then a COMP-3 field
>containing X'123D' may pass an IS NUMERIC test while not, by your
>standard, containing an numeric digit.

1, 2, and 3 are numeric digits, no? The sign nybble is ignored.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: My COBDATA problem
Next: License Management Service