‎2006 Aug 25 5:18 PM
Hi,
I want to do following conversion for a data:
abcdeghtyju -> abcdegh tyju
126789384 -> 12678 9384
afg37784df -> afg377 84df
Briefly, the last four numbers (alphanumerics) should split from the rest and create a data with
beginning numbers , space and last 4 digits.
Rajesh..
‎2006 Aug 25 5:23 PM
v_len = strlen( v_str ).
v_index = v_len - 4.
last_4 = v_str+v_index(4).
first_part = v_str+0(v_len).
concatenate first_part last_4 into v_str_new separated by space.
Regards,
ravi
‎2006 Aug 25 5:21 PM
hi rajesh,
first reverse the string with STRING_REVERSE FM and then split that string after 4 characters and then concatenate all of them in to a new variable and then again use FM STRING_REVERSE. this fetches the result that you are looking for ...
regards,
santosh
‎2006 Aug 25 5:23 PM
v_len = strlen( v_str ).
v_index = v_len - 4.
last_4 = v_str+v_index(4).
first_part = v_str+0(v_len).
concatenate first_part last_4 into v_str_new separated by space.
Regards,
ravi
‎2006 Aug 25 5:29 PM
parameter: char1(30).
data: ONE(10) TYPE C,
TWO(10) TYPE C,
<b>one = char1+0(7).
two = char1+6(4).</b>
concatenate one two into char1 seperated by space.
modify the bolded code accordingly