Assigning Parts of Character Strings 

The following variant of the MOVE statement works only with type C fields:

MOVE <c1> TO <c2> PERCENTAGE <p> [RIGHT].

Copies the percentage <p> percent of the character field <c1> left-justified (or right-justified if specified with the RIGHT option) to <c2>.

The value of <p> can be a number between 0 and 100. The length to be copied from <f1> is rounded up or down to the next whole number.

If one of the arguments in the statement is not type C, the parameter PERCENTAGE is ignored.

DATA C1(10) VALUE 'ABCDEFGHIJ',
C2(10).

MOVE C1 TO C2 PERCENTAGE 40.

WRITE C2.

MOVE C1 TO C2 PERCENTAGE 40 RIGHT.

WRITE / C2.

Output:

'ABCD       '

       ABCD