The MOVE Statement
Syntax
Format 1
MOVE { identifier-1
literal-1 } TO {identifier-2} ...
Format 2
MOVE { CORRESPONDING
CORR } identifier-1 TO {identifier-2} ...
Description
The MOVE statement is used to copy data items to other data items. Each of the two formats works slightly differently and is described in the correspondingly numbered area.
1. The first format is used to copy a field or value to another field(s). The field or value listed between MOVE and TO is copied to the value of the field(s) following the TO. For example in MOVE A TO B, the value in A is copied to B. The value in A is unchanged. Furthermore, in MOVE C TO E F, the sum or the values in C and D is moved to the value in E, storing the answer in E and the sum of C and D is also moved to F storing the value in F. The values in C and D are unchanged.
2. The second format is used to copy subordinate field(s) of one group to subordinate field(s) in another. Those subordinate field(s) of the group item identifier-1 are copied to and those with exactly the same name in the group item identifier-2. The names of the subordinate items must be spelled exactly the same way in both groups to qualify to participate in the move.
Tips
1. If the receiving field is edited, any editing required will be done at the time of the MOVE.
2. If the receiving field is unedited and the sending field is edited, the field will be de-edited at the time of the MOVE.
3. If the sending field is shorter than the receiving field:
o Numeric fields are padded on the left with zeros.
o Non-numeric fields are padded on the right with spaces.
4. If the sending field is longer than the receiving field:
o Numeric fields are truncated on the left.
o Non-numeric fields are truncated on the right.
Syntax
Format 1
MOVE { identifier-1
literal-1 } TO {identifier-2} ...
Format 2
MOVE { CORRESPONDING
CORR } identifier-1 TO {identifier-2} ...
Description
The MOVE statement is used to copy data items to other data items. Each of the two formats works slightly differently and is described in the correspondingly numbered area.
1. The first format is used to copy a field or value to another field(s). The field or value listed between MOVE and TO is copied to the value of the field(s) following the TO. For example in MOVE A TO B, the value in A is copied to B. The value in A is unchanged. Furthermore, in MOVE C TO E F, the sum or the values in C and D is moved to the value in E, storing the answer in E and the sum of C and D is also moved to F storing the value in F. The values in C and D are unchanged.
2. The second format is used to copy subordinate field(s) of one group to subordinate field(s) in another. Those subordinate field(s) of the group item identifier-1 are copied to and those with exactly the same name in the group item identifier-2. The names of the subordinate items must be spelled exactly the same way in both groups to qualify to participate in the move.
Tips
1. If the receiving field is edited, any editing required will be done at the time of the MOVE.
2. If the receiving field is unedited and the sending field is edited, the field will be de-edited at the time of the MOVE.
3. If the sending field is shorter than the receiving field:
o Numeric fields are padded on the left with zeros.
o Non-numeric fields are padded on the right with spaces.
4. If the sending field is longer than the receiving field:
o Numeric fields are truncated on the left.
o Non-numeric fields are truncated on the right.