How to: |
Reference: |
LPAD uses a specified character and output length to return a character string padded on the left with that character.
LPAD(string, out_length, pad_character)
where:
Fixed length alphanumeric
Is a string to pad on the left side.
Integer
Is the length of the output string after padding.
Fixed length alphanumeric
Is a single character to use for padding.
In the following request against the WF_RETAIL data source, LPAD left-pads the PRODUCT_CATEGORY column with @ symbols:
DEFINE FILE WF_RETAIL LPAD1/A25 = LPAD(PRODUCT_CATEGORY,25,'@'); DIG1/A4 = DIGITS(ID_PRODUCT,4); END TABLE FILE WF_RETAIL SUM DIG1 LPAD1 BY PRODUCT_CATEGORY ON TABLE SET PAGE NOPAGE ON TABLE SET STYLE * TYPE=DATA,FONT=COURIER,SIZE=11,COLOR=BLUE,$ END
The output is: