Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
6-47
MOVE Statements
data-name-1
is the sending item. The item can be an identifier or a literal. Any subscripting or
indexing for data-name-1 is evaluated only once, immediately before data is
moved to the first receiving item.
data-name-2
is the receiving item. The item is an identifier. The following example:
MOVE item-1(b) TO item-2, item-3(b)
is equivalent to:
MOVE item-1(b) TO temp
MOVE temp TO item-2
MOVE temp TO item-3(b).
The following example illustrates a number of MOVE statements:
WORKING-STORAGE SECTION.
01 record-in.
05 item-a PIC X(5).
05 item-b PIC 99V99.
77 temp1 PIC X(4).
77 temp2 PIC X(8).
77 temp3 PIC 9(5)V999.
77 temp4 PIC 9V9.
PROCEDURE DIVISION.
begin-processing.
MOVE item-a TO temp1. (1)
MOVE item-a TO temp2. (2)
MOVE item-b TO temp3. (3)
MOVE item-b TO temp4. (4)
MOVE SPACES TO record-in.
MOVE ZEROS TO item-b.
(1) Item-a is truncated to fit temp1.
(2) The remainder of temp2 is blank filled.
(3) The remainder of temp3 is zero filled.
(4) If the value in item-b is greater than 9.9, this move causes the TCP to suspend
the program unit with an arithmetic overflow error.