From: William M. K. <wm...@ix...> - 2004-05-19 07:15:48
|
I now agree with your evaluation that the 2002 Standard (like the '85 Standard) does NOT allow the comparison of a integer data item and an alphanumeric (or national) item UNLESS the integer item is USAGE DISPLAY = or National. Where I looked was in the paragraph: 8.8.4.1.1 Relation conditions which (on page 127) states that it legal to have a comparison between: 6) Two operands where one is a numeric integer and the other is class alphanumeric or national. However, the paragraph that you quote from 8.8.4.1.1.4 Comparison of a numeric integer operand with an operand of class alphanumeric or national on page 128 does add an ADDITIONAL restriction that "The numeric integer operand shall be an integer literal or an integer numeric data item of usage display or national." It isn't particularly unusual for the Standard to have a "general" description which is LATER "further restricted". I had simply missed = that additional restriction. P.S. I think the rules for comparisons for integer numeric items and alphanumeric or national items is "clear" and would work as an EXTENSION when the integer item is of "any" USAGE. However, if that is supported = in OpenCOBOL - it should receive an "extension" flag. =20 > -----Original Message----- > From: Thomas Biehler [mailto:tob...@us...]=20 > Sent: Tuesday, May 18, 2004 6:39 AM > To: William M. Klein > Cc: Keisuke Nishida > Subject: Re: [open-cobol-list] Re: possibly bug: Compare:=20 > numeric (USAGE COMP ...) with alphanumeric >=20 > On Monday 17 May 2004 21:53, you wrote: > > I agree with you that the '85 Standard does *not* allow for=20 > a comparison > > between a numeric (non-DISPLAY) item and an alphanumeric=20 > item. This should > > get a "flaggint" (extension) message when done. > > > > However, the 2002 Standard eplicitly says, > > > > "Two operands where one is a numeric integer and the other is class > > alphanumeric or national.' >=20 > Ooops. !? > At which paragraph in the ISO 2002 Standard stands this sentence? > > > > Is allowed. Have I missed some place in the 2002 Standard=20 > that disallows > > such comparions (as you indicate)? > > >=20 > Yes, i think so. > I have showed it in my answer mail to Roger While from 08.05.2004. > If you are not a subscriber of the open-cobol mailinglist you can=20 > found it in the mail-archive at sourceforge.=20 >=20 > It follows the cruical excerpt of the ISO Standard 2002=20 > (Especially the first sentence of =A7 8.8.4.1.4 is significant!) >=20 > ISO/IEC 1989:2002(E)=20 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > =A78.8.4.1.1.4 Comparsion of a numeric integer operand with=20 > an operand of class alphanumeric or national >=20 > The numeric integer operand shall be an integer literal or=20 > integer numeric data item of usage display or national .... =20 > =20 > --> is now absolut clear and much easier to unterstand as=20 > in ANSI 1985 ! >=20 > Thomas >=20 >=20 >=20 |