Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

COPY

COPY returns a string consisting of y concatenated copies of the string x.

Read syntax diagramSkip visual syntax diagram>>-COPY(x,y)---------------------------------------------------><
 
x
Expression.

x must have a computational type and should have a string type. If not, it is converted to character.

y
An integer expression with a nonnegative value. It specifies the number of repetitions. It must have a computational type and is converted to FIXED BINARY(31,0).

If y is zero, the result is a null string.

Considering the following code:

  copy('Walla  ',1)         /*  returns 'Walla  '  */

  repeat('Walla  ',1)       /*  returns 'Walla  Walla  '  */

In the preceding example, repeat(x,n) is equivalent to copy(x,n+1).


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)