<?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 Re: compress few strings in a large string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/compress-few-strings-in-a-large-string/m-p/246674#M46177</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/69257"&gt;@lokeshbm&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I now wanted to remove those strings{not pre post text,&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;only the above mentioned words&lt;/STRONG&gt;&lt;/FONT&gt;}&amp;nbsp;from the dataset .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't see any list of mentioned words or characters. You need to define those.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can use a combination of translate or transwrd functions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regular expressions can probably help as well.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jan 2016 16:22:36 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-01-28T16:22:36Z</dc:date>
    <item>
      <title>compress few strings in a large string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compress-few-strings-in-a-large-string/m-p/246548#M46137</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a function or a loop which can compress multiple strings in one large string.&lt;/P&gt;&lt;P&gt;for ex:&amp;nbsp;if (salary &amp;gt;= 0 &amp;amp; salary &amp;lt;= 25000) then salcat_1 = "C";&amp;nbsp;&lt;/P&gt;&lt;P&gt;output should look like :&amp;nbsp;&lt;SPAN&gt;salary &amp;gt;= 0 &amp;amp; salary &amp;lt;= 25000&amp;nbsp;salcat_1 = "C"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Appreciate your help on this.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 05:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compress-few-strings-in-a-large-string/m-p/246548#M46137</guid>
      <dc:creator>lokeshbm</dc:creator>
      <dc:date>2016-01-28T05:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: compress few strings in a large string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compress-few-strings-in-a-large-string/m-p/246562#M46140</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please explain criterian for removing multiple strings?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;if (salary &amp;gt;= 0 &amp;amp; salary &amp;lt;= 25000) then salcat_1 = "C";&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the string above , you are eliminating "if" and "then". Will this be the same always? Every time we need to eliminate only "If" and "else"? Please be more explicit.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 07:56:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compress-few-strings-in-a-large-string/m-p/246562#M46140</guid>
      <dc:creator>ad123123</dc:creator>
      <dc:date>2016-01-28T07:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: compress few strings in a large string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compress-few-strings-in-a-large-string/m-p/246564#M46141</link>
      <description>&lt;P&gt;I am importing a file which has few strings {ex: IF THEN ELSE SELECT etc} ,I now wanted to remove those strings{not pre post text,only the above mentioned words}&amp;nbsp;from the dataset .&lt;/P&gt;&lt;P&gt;As i have split those in to observations,I am in serach of a best approach/logic, Just posted a basic example below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;input : if (salary &amp;gt;= 0 &amp;amp; salary &amp;lt;= 25000) then salcat_1 = "C";&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Output :&amp;nbsp;salary &amp;gt;= 0 &amp;amp; salary &amp;lt;= 25000&amp;nbsp;salcat_1 = "C"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 08:47:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compress-few-strings-in-a-large-string/m-p/246564#M46141</guid>
      <dc:creator>lokeshbm</dc:creator>
      <dc:date>2016-01-28T08:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: compress few strings in a large string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compress-few-strings-in-a-large-string/m-p/246575#M46147</link>
      <description>&lt;P&gt;What about the ()? &amp;nbsp;What about other characters? &amp;nbsp;If you just want to remove those then tranwrd() or compress() can do it:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  string=tranwrd(string,"if","");
  string=tranwrd(string,"then","");
run;&lt;/PRE&gt;
&lt;P&gt;However I question what you are doing, you appear to be reading in code, which can make parsing more difficult than just removing some characters, e.g.&lt;/P&gt;
&lt;P&gt;if (abc="I go on holiday if I booked it) then result="Sometimes (always)";&lt;/P&gt;
&lt;P&gt;will result in:&lt;/P&gt;
&lt;P&gt;(abc="I go on holiday I booked it) result="Sometimes (always)";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally, I would look at other methods to do this, including looking at the documentation - you do have that?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 10:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compress-few-strings-in-a-large-string/m-p/246575#M46147</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-28T10:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: compress few strings in a large string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compress-few-strings-in-a-large-string/m-p/246674#M46177</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/69257"&gt;@lokeshbm&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I now wanted to remove those strings{not pre post text,&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;only the above mentioned words&lt;/STRONG&gt;&lt;/FONT&gt;}&amp;nbsp;from the dataset .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't see any list of mentioned words or characters. You need to define those.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can use a combination of translate or transwrd functions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regular expressions can probably help as well.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 16:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compress-few-strings-in-a-large-string/m-p/246674#M46177</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-28T16:22:36Z</dc:date>
    </item>
  </channel>
</rss>

