If there are two fields defined:
DEFINE DATA
LOCAL
01 FIELD-1
02 LEVEL-2 (A10)
02 REDEFINE LEVEL-2
03 LEVEL31 (N4)
03 LEVEL32 (N4)
03 LEVEL33 (N2)
01 FIELD-2
02 LEVEL-2 (A10)
02 REDEFINE LEVEL-2
03 LEVEL31 (N4)
03 LEVEL32 (N4)
03 LEVEL33 (N2)
END-DEFINE
*
RESET FIELD-1 FIELD-2
WRITE 'FIELD-1: ' FIELD-1 ' FIELD-2: ' FIELD-2
*
MOVE ' ' TO FIELD-1.LEVEL-2
*
MOVE BY POSITION FIELD-1 TO FIELD-2
WRITE 'FIELD-1: ' FIELD-1 ' FIELD-2: ' FIELD-2
*
MOVE BY NAME FIELD-1 TO FIELD-2
WRITE 'FIELD-1: ' FIELD-1 ' FIELD-2: ' FIELD-2
END
If one does a MOVE BY POSITION, the result will be SPACES in FIELD-2.LEVEL-2.
If one does a MOVE BY NAME, the result will be ZEROES in FIELD-2.LEVEL-2.
Wat up wit dat, dog ? Who gave the compiler permission for this conversion in MOVE BY NAME ?? (Certainly, no programmer would! Of course for maintenance reasons no programmer would ever use MOVE BY NAME/POSITION but unfortunately there is some law that says “build an instruction and they will code”!!)