TRIMR
The TRIMR function removes trailing spaces from a string.
Syntax 1
function trimr (arg-1)
Syntax 2
$trimr (arg-1)
Arguments
arg-1 must be a alphanumeric data item or literal.
Result
The function returns the value of arg-1 stripped of trailing spaces.
Examples
Example - Display a combined message after trimming the spaces from the variable part.
working-storage section.
77 w-name pic x(32) value "John ".
...
procedure division.
...
display "Hello " function trimr(w-name) ", how are you?".