@Reeza
<Reverse the string and then take the substring. Reversing a string of 1 is 1.>
I understand the approach, but: 1) The strings are not 1 character in length (e.g. 13000M, x13260M); and 2) When the string is reversed, the syntax is still taking the character in the first position in the orginal, not reversed, string.
In other words, 13000M is new_var=1, both with, and without, the reverse function. Should new_var=M, given that the string was reversed? That's what I'm after...
When I use the functions separately the reverse function converts 13000M to M13000. When I then use the substring function, only a subset of the observations have the correct value. It's only the observations w/ the longest length (i.e. 7 characters). Any observation w/ less characters than that contains a missing value (See attached image).
... View more