The MOVE statement transfers data, in accordance with the rules of editing, to one or more data areas.
If identifier-1 is reference
modified, subscripted, or is a function-identifier, the reference modifier,
subscript, or function-identifier is evaluated only once, immediately before
data is moved to the first of the receiving operands.
The result of the statement:
MOVE a(b) TO b, c(b)
is equivalent to:
MOVE a(b) TO temp MOVE temp TO b MOVE temp TO c(b)
where temp is an intermediate result item provided by your COBOL system.
![]()
national,
national-edited, boolean,
![]()
![]()
or
floating-point.
These categories are described in the PICTURE clause. Numeric literals belong to the category numeric, and nonnumeric literals belong to the category alphanumeric. The figurative constant ZERO belongs to the category numeric when moved to a numeric or numeric-edited item. The figurative constant ZERO belongs to the category alphanumeric in all other cases. The figurative constant SPACE belongs to the category alphabetic. All other figurative constants belong to the category alphanumeric.
The following rules apply to an elementary move between these categories:
This restriction is removed.
![]()
or boolean.
![]()
or boolean.
, or
de-editing implied by,
the receiving data item:
When the sending operand is
numeric-edited, de-editing is implied to establish the operand's unedited
numeric value, which can be signed; then the unedited numeric value is moved to
the receiving field. The effect of de-editing depends on the setting of the
DE-EDIT Compiler directive
When a signed numeric item is the receiving item, the sign of the sending item is placed in the receiving item. (See the topic The SIGN Clause.) Conversion of the representation of the sign takes place as necessary. If the sending item is unsigned, a positive sign is generated for the receiving item.
When an unsigned numeric item is the receiving item, the absolute value of the sending item is moved and no operational sign is generated for the receiving item.
When a data item described as alphanumeric is the sending item, data is moved as if the sending item were described as an unsigned numeric integer.
When the receiving item is numeric or numeric-edited and the sending item is defined as alphanumeric, if the content of the sending item is not an integer, the results of the move are undefined. If the alphanumeric sending item is a literal whose contents do not represent an integer, an error is reported, and zero moved to the target. (See the topic Incompatible Data in the chapter Procedure Division.)
When the numeric data item
is the sending item the action of the move is such that a reverse of the move
would cause the same value to appear in the numeric-edited field (except for
truncation). If the data item contains data which does not conform to the
edited picture, zero is moved to the target.
![]()
When the receiving
field is national the sending item must be DBCS or national; no conversion
takes place. If the sending and receiving items are not the same size the data
item is either truncated or padded with national spaces on the right.
![]()
The process is repeated for
each destination group.
| Category of Sending Item | Category of Receiving Data Items1 | |||||
|---|---|---|---|---|---|---|
| Alphabetic | Alphanumeric-Edited/ Alpha-numeric | Numeric Integer/Non-Integer | Numeric-Edited External/Internal Floating Point | DBCS, national or national-edited | Boolean | |
| Alphabetic | Yes/4c | Yes/4a | No/3a | No/3a | No/4e | No/3f |
| Alphanumeric | Yes/4c | Yes/4a | Yes/4b | Yes/4b | No/4e | Yes/3e |
| Alphanumeric-Edited | Yes/4c | Yes/4a | No/3a | No/3a | No/4e | No/3f |
| Numeric Integer | No/3b | Yes/4a | Yes/4b | Yes/4b | No/4e | No/3f |
| Numeric Non-Integer | No/3b | No/3c | Yes/4b | Yes/4b | No/4e | No/3f |
| Numeric-Edited | No/3b | Yes/4a | Yes/4b | Yes/4b | No/4e | No/3f |
| DBCS national or national-edited | No/4e | No/4e | No/4e | No/4e | Yes/4e | No/3f |
| Boolean | No/3c | Yes/4a | No/3b | No/3b | No/3g | Yes/4f |
| 1 | The relevant rule number is quoted in these columns |
| 2 | An error is reported if a non-integer alphanumeric literal sending item is used |