There isn't an equivalent of a trim function in cobol because strings in cobol have a fixed size. For trimming leading spaces see thread209-665289. for trimming trailing spaces you can use
Dan, we decided to ask the “Gray Fox” (our Boss’ father) if he had a solution that would deal with leading and trailing spaces for each of the fixed length fields in a record. We asked if he could create a comma-delimited file with variable length fields with the leading and trailing spaces removed and it had to be done with COBOL? Within two hours he created the following example using Micro Focus Net Express (the source code is also included at the following location).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.