How to: |
The TRIMLEN function determines the length of a character string excluding trailing spaces.
TRIMLEN (string)
where:
Alphanumeric
Is the string to be measured.
TRIMLEN determines the length of a field in COUNTRY excluding trailing blanks:
MAINTAIN FILE CAR MODULE IMPORT (MNTUWS) NEXT COUNTRY INTO STK1 COMPUTE LEN/I3 = LENGTH(STK1(1).COUNTRY); COMPUTE LEN2/I3 = TRIMLEN(STK1(1).COUNTRY); TYPE "<STK1(1).COUNTRY HAS A LENGTH OF <LEN2 WITHOUT TRAILING BLANKS" END
The result is:
ENGLAND HAS A LENGTH OF 7 WITHOUT TRAILING BLANKS