[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] invalid VALUE clause
From: |
Keisuke Nishida |
Subject: |
Re: [open-cobol-list] invalid VALUE clause |
Date: |
Tue Feb 17 01:29:14 2004 |
User-agent: |
Wanderlust/2.10.0 (Venus) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (UnebigoryĆmae) APEL/10.3 Emacs/21.2 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI) |
At Tue, 10 Feb 2004 16:15:29 -0600,
William M. Klein wrote:
>
> Using Z's makes a numeric field a numeric-edited field, not an alphanumeric
> or alphanumeric-edited field. (The same is true about using the BLANK WHEN
> ZERO clause).
>
> The reason that a VALUE SPACE is invalid relates to the MOVE rules which (in
> the '85 Standard - on page VI-104) states,
It seems different rules are applied between the VALUE clause and
the MOVE statement. According to the COBOL 2002 standard,
| ISO/IEC 1989:2002
| 13.16.61 VALUE clause
| 13.16.61.2 4) If the item is of class alphabetic or alphanumeric,
| literals in the VALUE clause shall be alphanumeric literals. [...]
Note that the class of a numeric-edited field is alphanumeric,
though the category of it is numeric-edited. Thus, the VALUE clause
of a numeric-edited field must be an alphanumeric literal, and the
value SPACE would be legal here (even though it is not desirable).
Furthermore, as far as I can understand, the standard requires the
compiler *not* to check the value whether it matches to the picture
definition. For example, the following definition is legal:
01 X PIC ZZ9 VALUE "abc".
On the other hand, the MOVE statement requires numeric values to be
stored in numeric-edited items, and SPACE would be illegal here.
I'll fix this problem so that SPACE can be accepted.
Keisuke