COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-130
MOVE TO
The COBOL standard requires that the numeric item have no decimal positions.
HP allows this as an extension.
If an elementary receiver is described as JUSTIFIED, see JUSTIFIED Clause.
Numeric or Numeric Edited Receiving Data Items
Data is aligned by decimal point and filled with zeros as necessary.
If receiver is signed, the sign of sender is moved to receiver. If sender
has no sign, the new sign of receiver is positive.
If receiver is not signed, the absolute value of sender becomes the new value
of receiver.
If sender is alphanumeric, its value is treated as an unsigned numeric integer.
If sender is numeric-edited, the operand’s unedited numeric value is determined
(it can be signed). The unedited numeric value of sender is moved to receiver.
Group MOVE Statements
Group MOVE statements (MOVE statements in which sender, receiver, or
both are data structures) are treated as alphanumeric-to-alphanumeric moves, with
no data conversion. Receiving items are filled without regard to individual or
subordinate items in either sender or receiver s. If a receiver is an
elementary item defined with a JUSTIFIED clause, justification does occur. If
sender is a national data item, its size is assumed to be twice the number of
national characters. Verify the receiving data structure can hold all of the national
characters.
In Example 9-44, several MOVE TO statements set the values of two records in
working storage.
Example 9-44. MOVE TO Statements (page 1 of 2)
WORKING-STORAGE SECTION.
01 RECORD-IN.
03 ITEM-A PIC X(5) VALUE "AAAAA".
03 ITEM-B PIC 99V99 VALUE "2.38".
03 ITEM-C PIC ZZ,ZZ9.99.
...
01 TEMPS.
03 TEMP1 PIC X(4).
03 TEMP2 PIC X(8).
03 TEMP3 PIC 9(5)V999.
03 TEMP4 PIC 9V9.
03 TEMP5.
05 T PIC 99 OCCURS 12 TIMES.