ILE COBOL Language Reference

MOVE Statement Rules

+-------------------------------IBM Extension--------------------------------+

If either the sending or receiving item is a DBCS data-item, then both must be DBCS items. The DBCS sending item can also be a DBCS literal or the figurative constant SPACE. No data conversion is done; the data is either truncated or padded with DBCS spaces on the right.

+----------------------------End of IBM Extension----------------------------+

An index data item cannot be specified in a MOVE statement.

+-------------------------------IBM Extension--------------------------------+

A pointer data item (USAGE POINTER) or a procedure-pointer data item (USAGE PROCEDURE-POINTER) cannot be specified in a MOVE statement. To move an address into a pointer or procedure-pointer data item, use the SET statement.

+----------------------------End of IBM Extension----------------------------+

The evaluation of the length of the sending or receiving item may be affected by the DEPENDING ON phrase of the OCCURS clause (see OCCURS Clause).

Any length evaluation, subscripting, reference modification, or function

associated with the sending item (identifier-1 or literal-1) is evaluated only once, immediately before the data is moved to the first of the receiving items. Any length evaluation, subscripting, or reference modification associated with a receiving item (identifier-2) is evaluated immediately before the data is moved into it.

For example, 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. The subscript B has changed in value between the time that the first move took place and the time that the final move to C(B) is executed.

After execution of a MOVE statement, the sending item contains the same data as before execution (unless a receiving item overlaps the sending item in storage, in which case the contents are not predictable).


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]