JIM McINTOSH ([log in to unmask]) wrote:
: Please consider the following code. The result is that DATE-ERR-NUM is not
: equal to ZERO. When the picture is changed to PIC 9(4) (without the
: negative sign), the result is that DATE-ERR-NUM is equal to ZERO.
Yes, that is the correct behavior. When DATE-ERR-NUM is described
as PIC 9(4)- it is of class alphanumeric, so the comparison is
between "0000 " and "00000", which are not equal. There is no
automatic de-editing to convert DATE-ERR-NUM to a numeric operand.
: The
: question is: has it always been thus? Thanks in advance.
It's been this way at least since COBOL 74. If you're asking
about HP COBOL II, I don't remember it ever handling this wrong.
[snip]
Walter Murray
Hewlett-Packard
Support Technology Lab