skip to main content

Library Routines : C$TRIM

C$TRIM
The C$TRIM library routine performs a trim operation on alphanumeric variables.
Note: Since TRIM, TRIML and TRIMR intrinsic functions are available, this routine is deprecated.
Syntax:
 CALL "C$TRIM" USING var
Parameters:
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.
Examples:
Example - Remove leading spaces on a string
move " Hello COBOL World" to str1
call "c$trim" using str1

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left