Data Flow

When the STRING statement is executed, data is transferred from the sending fields to the receiving field. The order in which sending fields are processed is the order in which they are specified. The following rules apply:

Subscripting, reference modification, variable-length calculations, or function evaluations are performed only once, at the beginning of the processing of the STRING statement. So if identifier-3 or identifier-4 is used as a subscript, reference modifier, or function argument in the STRING statement, or affects the length or location of any identifiers of the STRING statement, these values are determined at the beginning of the STRING statement, and are not affected by any results of the STRING statement.

If identifier-1 or identifier-2 occupy the same storage area as identifier-3 or identifier-4, or if identifier-3 and identifier-4 occupy the same storage area, the result of the execution of the STRING statement is undefined.

After STRING statement execution is completed, only that part of the receiving field into which data was transferred is changed. The rest of the receiving field contains the data that was present before this execution of the STRING statement.

When the following STRING statement is executed, the results obtained will be like those illustrated in Figure 1.
STRING ID-1 ID-2 DELIMITED BY ID-3
       ID-4 ID-5 DELIMITED BY SIZE
  INTO ID-7 WITH POINTER ID-8
END-STRING
Figure 1. Results of STRING Statement Execution
This figure illustrates the results of STRING Statement Execution