pottmi wrote:
> (snip)
>
> The commented out MOVE statement produces this error on the latest
> version of microfocus compiler:
>
> pottmi@[EMAIL PROTECTED]
> cob moverule.cbl
> 20 MOVE ACOMP3 TO ADISPLAY.
> *1029-
> E***************************
> **
> ** A non-integer is being moved to an alphanumeric data item
>
> Given that, can you clarify your statement that the MOVE is legal?
I really cannot speak for Pete Dashwood, but I am sure there are COBOL
compilers that allow the MOVE statement as written. I think the
Fujitsu COBOL compiler might be one. The question is, if a particular
COBOL compiler allows this kind of MOVE, what does it actually do?
There are versions of the IBM mainframe COBOL compiler that will
attempt a conversion from packed decimal to zoned decimal with this
kind of statement. I can't recall if that includes the current
Enterprise COBOL for z/OS, but I'm pretty sure VS COBOL II did that,
and I was surprised when I discovered it.
I don't think there is anything in the COBOL standard that would
prevent a COBOL compiler from treating this as a move of one string of
characters to another, with no conversion, but perhaps Bill Klein can
give a definitive answer.
In my opinion, it's always a bad idea to move packed-decimal data to a
PIC X field, and I would always prefer a more explicit data
conversion, such as Pete suggested. So I don't think there's anything
wrong with MicroFocus disallowing that MOVE statement.
Cheers,
--
http://arnold.trembley.home.att.net/


|