How to: |
Given a source string and an integer number, REPEAT returns a string with the source string repeated that number of times. The string containing the repeated strings must be large enough to fit the repetitions or it will contain a truncated value.
REPEAT(source_str, number)
where:
Alphanumeric
Is the source string to be repeated. If source_str is a field, the entire field, including blanks, will be repeated.
Numeric
Is the number of times to repeat the source string.
The following request returns a string with FIRST_NAME repeated three times.
TABLE FILE EMPLOYEE PRINT FIRST_NAME COMPUTE REPEAT3/A25 = REPEAT(FIRST_NAME,3); ON TABLE SET PAGE NOLEAD ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * GRID=OFF,$ ENDSTYLE END
The PDF output is shown in the following image.