Returns a character string with specified characters removed from the original string.
Category: | Character |
Restriction: | I18N Level 0 functions are designed for use with Single Byte Character Sets (SBCS) only. |
Tip: | DBCS equivalent function is KCOMPRESS. |
specifies a character constant, variable, or expression from which specified characters will be removed.
specifies a character constant, variable, or expression in which each non-blank character modifies the action of the COMPRESS function. Blanks are ignored. The following characters can be used as modifiers:
a or A | adds alphabetic characters to the list of characters. |
c or C | adds control characters to the list of characters. |
d or D | adds digits to the list of characters. |
f or F | adds the underscore character and English letters to the list of characters. |
g or G | adds graphic characters to the list of characters. |
h or H | adds a horizontal tab to the list of characters. |
i or I | ignores the case of the characters to be kept or removed. |
k or K | keeps the characters in the list instead of removing them. |
l or L | adds lowercase letters to the list of characters. |
n or N | adds digits, the underscore character, and English letters to the list of characters. |
o or O | processes the second and third arguments once rather than every time the COMPRESS function is called. Using the O modifier in the DATA step (excluding WHERE clauses), or in the SQL procedure, can make COMPRESS run much faster when you call it in a loop where the second and third arguments do not change. |
p or P | adds punctuation marks to the list of characters. |
s or S | adds space characters (blank, horizontal tab, vertical tab, carriage return, line feed, and form feed) to the list of characters. |
t or T | trims trailing blanks from the first and second arguments. |
u or U | adds uppercase letters to the list of characters. |
w or W | adds printable characters to the list of characters. |
x or X | adds hexadecimal characters to the list of characters. |