Move Verb in COBOL
Data movement is governed by the following rules.
(a) The contents of identifier – 1 or the value of literal – 1 is moved to identifier – 2, identifier – 3, etc. Note that there may be more than one receiving field whereas there must be only one sending field, the contents of all the receiving fields will be replaced by the value of the sending field. The contents of identifier – 1 remain unaltered.
(b) When the sending field is numeric and the receiving field is numeric or numeric edited the data movement is called numeric data transfer. In such cases, the dominant factor in the movement is the alignment of the decimal points of the two fields. For this alignment, the numeric fields for which the position of the decimal point is not
explicitly indicated, the decimal point is assumed to be at the right of the rightmost digit. If the receiving field is not large enough to hold the data received, truncation can take place at either and depending on whether the integral part, fractional part or both can or cannot be accommodated. However, if significant integral positions are likely to be lost, a warning to that effect is issued by the compiler. On the other hand, if the receiving field is larger than the sending field, zero-fill will take place in the unused positions to keep the numeric value unaltered.
(c) When both the sending and receiving fields are alphabetic, alphanumeric or alphanumeric edited, the data movement is called alphanumeric data transfer. In such cases, the receiving area is filled from left to right and space fill occurs to the right if the receiving area is larger than the sending field. When the receiving area is smaller, truncation occurs from the right and the compiler gives a warning to that effect.