How to: |
The RTRIM function removes all blanks from the right end of a string.
RTRIM(string)
where:
Alphanumeric
Is the string to trim on the right.
The data type of the returned string is AnV, with the same maximum length as the source string.
The following request against the MOVIES data source creates the field DIRSLASH, that contains a slash at the end of the DIRECTOR field. Then it creates the TRIMDIR field, which trims the trailing blanks from the DIRECTOR field and places a slash at the end of that field:
TABLE FILE MOVIES PRINT DIRECTOR NOPRINT AND COMPUTE DIRSLASH/A18 = DIRECTOR|'/'; TRIMDIR/A17V = RTRIM(DIRECTOR)|'/'; WHERE DIRECTOR CONTAINS 'BR' ON TABLE SET PAGE NOPAGE END
On the output, the slashes show that the trailing blanks in the DIRECTOR field were removed in the TRIMDIR field:
DIRSLASH TRIMDIR -------- ------- ABRAHAMS J. / ABRAHAMS J./ BROOKS R. / BROOKS R./ BROOKS J.L. / BROOKS J.L./