Hi,
While searching on internet I came across following code:
Source-string = " SSET"
If we need to get string without spaces, trim the string. we can use
following logic.
INSPECT FUNCTION REVERSE (Source-string) TALLYING space-count FOR LEADING SPACES.
COMPUTE length-of-string = 6 - space-count.
Move Source-string(space-count+1 : length-of-string ) TO ws-target-string.
Above INSPECT command get the no of leading spaces from the string. after executing the INSPECT command space-count variable contains 2.
In compute statement, space-count subtracted from length of Source-string. value 4 will be stored in length-of-string.
In move statement, Using reference modification, moved actual string to ws-target-string. removed spaces.
But for this code we need to know how many characters are there in the 'source-string' that we actually want(4 here)
I guess Robert you are right there is no way I found so far to get the desired result(actual length of the data)