CALL "C$TRIM" USING var |
var | PIC X(n) | If var is defined as pic x any length, the trim removes leading and trailing spaces and the variable is resized. If var is defined as pic x(n), the trim only removes leading spaces, the result is the same of a left justification of the variable made by calling C$JUSTIFY. Variables that are not alphanumeric produce undefined effects. |
*> define str1 as pic x(n) move " Hello COBOL World" to str1 call "c$trim" using str1 *> the first 3 spaces will be removed |