@agbpilot,
I'm not quite sure what you're after in this specific case. I'm a little hesitant to open the attachment. It's probably fine, but if I do open it and something happens, I could get in serious trouble.
So, let's talk code a bit. When you code Tranwrd as follows this is going to perform text removal.
ownr_city_v2 = tranwrd(Propcase(ownr_city),strip(Propcase(city_value)),"");
If all or part of ownr_city matches what is in city_value, that portion of the text will be replaced by "" (nothing in other words) and thus the text will be removed. For example, if ownr_city is "Old York", and the value in city_value is "Old", then Old will be removed and you'll just have "York" left. Here's the output of the above code:
On the other hand, if you code Tranwrd as shown below, this is going to perform text replacement.
ownr_city_v2 = tranwrd(Propcase(ownr_city),strip(Propcase(city_value)),"New");
In this case if ownr_city contains the value that is in city_value, that value will be replaced by whatever is in the third argument to the function, in this case, "New". Here's the output of the above code:
Notice also that I added the Propcase function which is going to capitalize the first letter of each token and render the remainder in lower case. Using Propcase, Upcase, or Lowcase eliminates case sensitivity. If you don't use one of these case functions, "York" does not equal "york".
So, are you wanting to remove text or replace text? Both are legitimate, but I'm not sure exactly what it is you're after in this case.
Jim
... View more