MOVE - PERCENTAGE
MOVE source TO destination PERCENTAGE perc [LEFT|RIGHT].
This variant of the statement
(also obsolete), which is not permitted in classes, assigns the substring of the data object
that begins at the first position and whose length matches the percentage of the total length of
source specified in
perc, to the data object
By default, and if
LEFT is specified,
destination is left-justified; if
RIGHT is specified, it is right-justified.
The data type of the data objects
must be character-like, otherwise the addition
PERCENTAGE is ignored.
perc expects a data object of type
i. If the value of
is less than or equal to 0, nothing is assigned. If the value of
perc is greater than or equal to 100, the entire content of
source is assigned.
MOVE c1 TO c2 PERCENTAGE n.
DATA l TYPE i.
DESCRIBE FIELD c1 LENGTH l.
l = l * n / 100.
MOVE c1(l) TO c2.