Joined: 22 Aug 2005 Posts: 413 Location: Colarado, US
Since you're trying to move an Alphanumeric value to a numeric field, the compiler rules dictate that the sending field be numeric and unsigned.
01 A PIC X(04).
01 B PIC 9(04).
MOVE 'ABCD' TO A
MOVE A TO B
DISPLAY 'VALUE OF B IS : ' B
In the above example since you're trying to move X'C1C2C3C4' (an A/N value) to a numeric field, the compiler rules dictate that the sending field be numeric and unsigned.
It looks like it doesn't care about the non-sign digits (GIGO), but forces the 4 high order sign bits of the low order digit to X'F', overlaying the X'C' that's there. Since the low order bits of that digit is X"4" the full byte is X'F4' or a DISPLAY "4".