Re: In answer to RW - again (was: Sorts (revised)

From: Robert Wagner (robert.deletethis_at_wagner.net)
Date: 07/13/04


Date: Tue, 13 Jul 2004 09:55:48 GMT


"Chuck Stevens" <charles.stevens@unisys.com> wrote:

>
>"Robert Wagner" <robert.deletethis@wagner.net> wrote in message
>news:40ec9718.379541379@news.optonline.net...
>
>> >> move 'A' to foo
>> >> if foo is numeric
>> >> display 'someone does not know how class tests should work'
>> >> end-if
>> >
>> >Which specific environments will do the display ? Which compilers,
>> >what versions ? (hint: mine don't).
>>
>> Best I remember, it was Honeywell .. but might have been Burroughs. The
>compiler
>> said IF NUMERIC 'should' be made against PIC 9. If you made it against PIC
>X, you
>> must accept the default substituion, which was S9(1).
>
>Such an implementation would, it seems to me, be in violation of ANSI
>X3.23-1974 page II-43, 5.2.1.2, Class condition, second paragraph.
>
>"The usage of the operand being tested must be described as display. ...
>The NUMERIC test cannot be used with an item whose data description
>describes the item as alphabetic or as a group item composed of elementary
>items whose data description indicates the presence of operational sign(s).
>If the data description of the data item begin tested does not indicate the
>presence of an operational sign [note: I'd say this includes both PICTURE 9
>and PICTURE X], the item being tested is determined to be numeric only if
>the contents are numeric and an operational sign is not present. ..."

After reading that, it is clear the compiler was in violation. I distinctly
remember writing IF X IS NUMERIC AND X NOT ALPHABETIC. I remember another
compiler that refused to do IF NUMERIC on anything but PICTURE 9.

>Note: the 2002 standard does allow NUMERIC tests against items of category
>NUMERIC; it no longer limits such tests to USAGE DISPLAY.

That must be about packed decimal. Everything is valid in binary.



Relevant Pages

  • Re: In answer to RW - again (was: Sorts (revised)
    ... The NUMERIC test cannot be used with an item whose data description ... presence of an operational sign [note: I'd say this includes both PICTURE 9 ... the standard, the corresponding Hollerith code acceptable to a COBOL numeric ... it no longer limits such tests to USAGE DISPLAY. ...
    (comp.lang.cobol)
  • Re: PIC S9(11).9(2) USAGE DISPLAY illegal?
    ... WMK> looks like a reasonable PICTURE clause to me. ... the compiler only issued only a warning concering the ... "Die Interessen der Nation lassen sich nicht anders formulieren als unter ...
    (comp.lang.cobol)
  • Re: Computer Statement Usage
    ... >>whether there will be any loss of precision without ... >>digits the compiler will supply to protect against loss ... > compiler will supply an intermediate with size a+b so no left digits ... there is a very good chance the compiler will use the picture ...
    (comp.lang.cobol)
  • Re: Read flat file field +123.45 in Cobol2 - How please ?
    ... *chose* to implement only Nucleus Level 1, ... Nucleus Level 2 aren't out of compliance. ... through the very PICTURE clause associated with the item, ... The compiler may *try* to de-edit the data from the PICTURE clause, ...
    (comp.lang.cobol)
  • Re: Computer Statement Usage
    ... or the compiler always using extended ... >> rearranging the expression is the same. ... Without knowing the picture clauses of all the variables ... A has more guard digits than required. ...
    (comp.lang.cobol)