<?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: Make new file based on a Text string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Make-new-file-based-on-a-Text-string/m-p/333602#M75207</link>
    <description>Thanks a lot for your suggestions.&lt;BR /&gt;HHC</description>
    <pubDate>Thu, 16 Feb 2017 22:02:41 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2017-02-16T22:02:41Z</dc:date>
    <item>
      <title>Make new file based on a Text string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Make-new-file-based-on-a-Text-string/m-p/333567#M75191</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to take all records from the below file out where name variable as a certain phrase like "abc1".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the file the new file will contain record 2 and 3 in the file below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input name $ 20.;
datalines;
cost_ab
value_abc1
textabc12_x
testabc
; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 20:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Make-new-file-based-on-a-Text-string/m-p/333567#M75191</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-02-16T20:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Make new file based on a Text string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Make-new-file-based-on-a-Text-string/m-p/333578#M75197</link>
      <description>&lt;P&gt;You can use 'contains' in a where statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; name contains &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'abc1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 20:46:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Make-new-file-based-on-a-Text-string/m-p/333578#M75197</guid>
      <dc:creator>nehalsanghvi</dc:creator>
      <dc:date>2017-02-16T20:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Make new file based on a Text string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Make-new-file-based-on-a-Text-string/m-p/333584#M75201</link>
      <description>&lt;P&gt;You can use either function &lt;STRONG&gt;contains&lt;/STRONG&gt;, as proposed by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/41810"&gt;@nehalsanghvi&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;or&amp;nbsp;&lt;STRONG&gt;if index(name,'abc1') &amp;gt; 0&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in case you are looking for digits in name you can use:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if indexc(name,'012345678') &amp;gt; 0&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 20:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Make-new-file-based-on-a-Text-string/m-p/333584#M75201</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-02-16T20:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Make new file based on a Text string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Make-new-file-based-on-a-Text-string/m-p/333602#M75207</link>
      <description>Thanks a lot for your suggestions.&lt;BR /&gt;HHC</description>
      <pubDate>Thu, 16 Feb 2017 22:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Make-new-file-based-on-a-Text-string/m-p/333602#M75207</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-02-16T22:02:41Z</dc:date>
    </item>
  </channel>
</rss>

