<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Fail to replace multiple targets using tranwrd using  a loop. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fail-to-replace-multiple-targets-using-tranwrd-using-a-loop/m-p/400898#M278687</link>
    <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;*There is a earlier topic describing how to replace multiple targets using tranwrd in a loop function. Unfortunately it is somehow not working for all types of Words that I want to replace. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;In the below code I want to remove. &lt;FONT color="#800080" face="Courier New"&gt;"koncern-LK.ramme" but the function fails to do so. Does anybody know what I am doing wrong?. Thx&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; x;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; y;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;newName = OldName;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; word=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"kon.-LK"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"koncern-LK.ramme"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;newName = tranwrd(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;||newName, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;||strip(word)||&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;newName&amp;nbsp; = compbl(newName );&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; word;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2017 10:37:58 GMT</pubDate>
    <dc:creator>Kelroy22</dc:creator>
    <dc:date>2017-10-04T10:37:58Z</dc:date>
    <item>
      <title>Fail to replace multiple targets using tranwrd using  a loop.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fail-to-replace-multiple-targets-using-tranwrd-using-a-loop/m-p/400898#M278687</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;*There is a earlier topic describing how to replace multiple targets using tranwrd in a loop function. Unfortunately it is somehow not working for all types of Words that I want to replace. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;In the below code I want to remove. &lt;FONT color="#800080" face="Courier New"&gt;"koncern-LK.ramme" but the function fails to do so. Does anybody know what I am doing wrong?. Thx&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; x;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; y;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;newName = OldName;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; word=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"kon.-LK"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"koncern-LK.ramme"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;newName = tranwrd(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;||newName, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;||strip(word)||&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;newName&amp;nbsp; = compbl(newName );&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; word;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 10:37:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fail-to-replace-multiple-targets-using-tranwrd-using-a-loop/m-p/400898#M278687</guid>
      <dc:creator>Kelroy22</dc:creator>
      <dc:date>2017-10-04T10:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Fail to replace multiple targets using tranwrd using  a loop.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fail-to-replace-multiple-targets-using-tranwrd-using-a-loop/m-p/400912#M278688</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/169437"&gt;@Kelroy22&lt;/a&gt;:&lt;/P&gt;&lt;P&gt;Your problem is probably the length of the WORD variable - the DO statement initializes the variable to the length of the first value in the iteration, as you can see from this log:&lt;/P&gt;&lt;PRE&gt;1507  data _null_;
1508    do word="kon.-LK", "koncern-LK.ramme";
1509      put word;
1510      end;
1511  run;

kon.-LK
koncern&lt;/PRE&gt;&lt;P&gt;If you add a LENGTH statement it should work:&lt;/P&gt;&lt;PRE&gt;1512  data _null_;
1513    length word $20;
1514    do word="kon.-LK", "koncern-LK.ramme";
1515      put word;
1516      end;
1517  run;

kon.-LK
koncern-LK.ramme&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Oct 2017 12:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fail-to-replace-multiple-targets-using-tranwrd-using-a-loop/m-p/400912#M278688</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2017-10-04T12:00:50Z</dc:date>
    </item>
  </channel>
</rss>

