CENTERRIGHT returns a string that is the result of inserting string x in the center (or one position to the right of center) of a string with length y and padded on the left and on the right with the character z as needed.
Specifying a value for z is optional.
>>-+-CENTERRIGHT-+--(x,y-+----+-)------------------------------>< '-CENTRERIGHT-' '-,z-'
dcl Source char value('Feel the Power');
dcl Target20 char(20);
dcl Target21 char(21);
Target20 = centerright (Source, length(Target20), '*');
/* '***Feel the Power***' - exactly centered */
Target21 = centerright (Source, length(Target21), '*');
/* '****Feel the Power***' - leaning right! */
If z is omitted, a blank is used as the padding character.