<?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: Deleting particular strings from variable's names in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Deleting-particular-strings-from-variable-s-names/m-p/500252#M133192</link>
    <description>Thanks. It is so helpful.</description>
    <pubDate>Mon, 01 Oct 2018 02:34:01 GMT</pubDate>
    <dc:creator>Saba1</dc:creator>
    <dc:date>2018-10-01T02:34:01Z</dc:date>
    <item>
      <title>Deleting particular strings from variable's names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-particular-strings-from-variable-s-names/m-p/500147#M133156</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with a variable of "Comp_Name", it consists of the long names of various companies. I want to delete the observations where "company_name" includes&amp;nbsp;specific strings e.g.&amp;nbsp;‘IDX’, ‘S&amp;amp;P’,&amp;nbsp; ‘DOW JONES’ and ‘MSCI’.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please&amp;nbsp;see the sample below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input ID Comp_Name $;
datalines;
 105246 AARI Growth S&amp;amp;P: Social Principl Inst.
 105246 AARI Growth S&amp;amp;P: Social Principl Inst.
 105290 Atlas Assets Inc. Health Servc
 105290 Atlas Assets Inc. Health Servc
 105290 Atlas Assets Inc. Health Servc
 116020 AARE Income: Invst IDX
 147001 Evergreen Select: Dow Jones: Diversified Value
 147001 Evergreen Select: Dow Jones: Diversified Value
; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want;
input ID Comp_Name $;
datalines;
 105290 Atlas Assets Inc. Health Servc
 105290 Atlas Assets Inc. Health Servc
 105290 Atlas Assets Inc. Health Servc
; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need your guidance. Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 30 Sep 2018 05:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-particular-strings-from-variable-s-names/m-p/500147#M133156</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2018-09-30T05:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting particular strings from variable's names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-particular-strings-from-variable-s-names/m-p/500149#M133158</link>
      <description>&lt;P&gt;Do like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input ID $ Comp_Name $50.;
infile datalines missover;
datalines;
105246 AARI Growth S&amp;amp;P: Social Principl Inst.
105246 AARI Growth S&amp;amp;P: Social Principl Inst.
105290 Atlas Assets Inc. Health Servc
105290 Atlas Assets Inc. Health Servc
105290 Atlas Assets Inc. Health Servc
116020 AARE Income: Invst IDX
147001 Evergreen Select: Dow Jones: Diversified Value
147001 Evergreen Select: Dow Jones: Diversified Value
;

data want;
   set have;
   where prxmatch("m/idx|dow jones|msci|s&amp;amp;p/oi",Comp_Name)=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 30 Sep 2018 06:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-particular-strings-from-variable-s-names/m-p/500149#M133158</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-09-30T06:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting particular strings from variable's names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-particular-strings-from-variable-s-names/m-p/500169#M133169</link>
      <description>&lt;P&gt;Better add \b for matching a word ,not a string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input ID $ Comp_Name $50.;
infile datalines missover;
datalines;
105246 AARI Growth S&amp;amp;P: Social Principl Inst.
105246 AARI Growth S&amp;amp;P: Social Principl Inst.
105290 Atlas Assets Inc. Health Servc
105290 Atlas Assets Inc. Health Servc
105290 Atlas Assets Inc. Health Servc
116020 AARE Income: Invst IDX
147001 Evergreen Select: Dow Jones: Diversified Value
147001 Evergreen Select: Dow Jones: Diversified Value
;

data want;
   set have;
   if prxmatch('/\b(idx|dow jones|msci|s&amp;amp;p)\b/oi',Comp_Name) then delete;
run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 30 Sep 2018 12:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-particular-strings-from-variable-s-names/m-p/500169#M133169</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-09-30T12:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting particular strings from variable's names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-particular-strings-from-variable-s-names/m-p/500252#M133192</link>
      <description>Thanks. It is so helpful.</description>
      <pubDate>Mon, 01 Oct 2018 02:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-particular-strings-from-variable-s-names/m-p/500252#M133192</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2018-10-01T02:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting particular strings from variable's names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-particular-strings-from-variable-s-names/m-p/500253#M133193</link>
      <description>Thanks a lot.</description>
      <pubDate>Mon, 01 Oct 2018 02:34:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-particular-strings-from-variable-s-names/m-p/500253#M133193</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2018-10-01T02:34:13Z</dc:date>
    </item>
  </channel>
</rss>

