An alphanumeric value should not be moved to a numeric field. Because alphanumeric values are stored differently than numeric values, simply moving
the bits from one field to the other will yield strange results at best, and crashes at worst.
Instead, NUMVAL
should be used to explicitly convert the alphanumeric value to a numeric one.
Noncompliant code example
01 MY-STR PIC X(3) VALUE SPACES.
01 MY-NUM PIC 9(3) VALUE ZEROES.
*> ...
MOVE '1' TO MY-STR
MOVE MY-STR TO MY-NUM *> Noncompliant
Compliant solution
01 MY-STR PIC X(3) VALUE SPACES.
01 MY-NUM PIC 9(3) VALUE ZEROES.
*> ...
MOVE '1' TO MY-STR
COMPUTE MY-NUM = FUNCTION NUMVAL(MY-STR)
or
01 MY-STR PIC X(3) VALUE SPACES.
01 MY-STR-RED REDEFINES MY-STR PIC 9(3).
01 MY-NUM PIC 9(3) VALUE ZEROES.
*> ...
IF MY-STR NUMERIC
MOVE MY-STR-RED TO MY-NUM
END-IF