Copies a particular string a certain number of times and concatenates the result into a single string.
COPY(x,y)
x is a character-string, bit-string, or picture value, and y is a positive integer expression. If x is an arithmetic value, it is converted to a bit string if it is binary, or to a character string if it is decimal.
DECLARE X CHAR(6); X = COPY('AB',3) /* returns X = 'ABABAB' */
Note that the same result could be produced by using a string repetition factor, as illustrated below:
X = (3) 'AB';
None.
Description
The COPY function copies a particular string, x, a certain number of times, y, and concatenates the result into a single string. COPY effectively returns a string containing y occurrences of the string argument, with length y* length (x).
The result is obtained by concatenating y occurrences of x together.