Commonly used in projects: MOVE-CORRESPONDING <string1> TO <string2>.
1 Assign with MOVE
basic assignment
MOVE <f1> TO <f2>.
<f2> = <f1>.
Assign value with specified offset
MOVE <f1>[+<o1>][(<l1>)] TO <f2>[+<o2>][(<l2>)].
Assign the segment content of field <f1> starting from position <o1>+1 and having a length of <l1> to field <f2>, covering the segment starting from position <o2>+1 and having a length of <l2>.
Assigning values between string components
MOVE-CORRESPONDING <string1> TO <string2>.
Assign the content of the field string <string1> component to the field string <string2> component with the same name .
2 Assign value using WRITE TO
WRITE <f1> TO <f2> [<option>].
The WRITE TO statement writes the contents of the source field <f1> to the target field <f2>
<f1> can be any data object, <f2> must be a variable, and the source field content is always converted to type C
For <option>, all formatting options of the WRITE statement are available (except UNDER and NO-GAP)
Specify source fields at runtime
WRITE (<f>) TO <g>.
Write value with specified offset
WRITE <f1>[+<o1>][(<l1>)] TO <f2>[+<o2>][(<l2>)].
Assign the content of field <f1> starting at position <o1>+1 and having a length of <l1> to field <f2>, covering the segment starting at position <o2>+1 and having a length of <l2>.
The offset and length of the target field can be specified as variables.