<?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: create a new dataset based on certin keywords from existing dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328449#M73333</link>
    <description>&lt;P&gt;The contains operator can only be used in a datastep's where clause. However, you can accomplish the same thing with a series of statements that use the FIND function. Take a look at:&amp;nbsp;&lt;A href="http://support.sas.com/kb/43/303.html" target="_blank"&gt;http://support.sas.com/kb/43/303.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH,&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2017 14:56:47 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-01-30T14:56:47Z</dc:date>
    <item>
      <title>create a new dataset based on certin keywords from existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328329#M73300</link>
      <description>&lt;P&gt;My dataset consists a variable named as "REPORTING_ENTITY" in the form of string. Now, from that variable i want create a new dataset which consist a observations with keywords as ('Bank','Loan','Cooperative','SBI','Insurance') from "&lt;SPAN&gt;REPORTING_ENTITY" also want that strings get deleted from original dataset. I did something like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data class.sample;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;set work.sample;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where REPORTING_ENTITY contains&amp;nbsp;('Bank','Loan','Cooperative','SBI','Insurance');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This will create a new dataset with mentioned keywords but it will not get deleted from orignal dataset..&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 07:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328329#M73300</guid>
      <dc:creator>bits</dc:creator>
      <dc:date>2017-01-30T07:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: create a new dataset based on certin keywords from existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328334#M73301</link>
      <description>&lt;P&gt;Just to see if I understand correctly, you want a new variable i your new dataset based on the variable&amp;nbsp;&lt;SPAN&gt;REPORTING_ENTITY, where you want the substring eg "Bank" to be deleted from the string such that eg "New York Bank" becomes "New York"? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 07:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328334#M73301</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-01-30T07:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: create a new dataset based on certin keywords from existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328335#M73302</link>
      <description>&lt;P&gt;I would do it like that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data
  class.sample
  work.origsample
;
set work.sample;
if REPORTING_ENTITY contains ('Bank','Loan','Cooperative','SBI','Insurance')
then output class.sample;
else output work.origsample;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once you have verified that the step ran successfully, you can remove work.sample and rename work.origsample to work.sample.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 07:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328335#M73302</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-30T07:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: create a new dataset based on certin keywords from existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328337#M73303</link>
      <description>&lt;P&gt;no...... i want "newyork bank" to be seperated whole from existing dataset not only "bank"...plz help me on this...&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 07:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328337#M73303</guid>
      <dc:creator>bits</dc:creator>
      <dc:date>2017-01-30T07:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: create a new dataset based on certin keywords from existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328339#M73304</link>
      <description>&lt;P&gt;So the entire observation? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; If so then see&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;s solution&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 08:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328339#M73304</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-01-30T08:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: create a new dataset based on certin keywords from existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328348#M73310</link>
      <description>&lt;P&gt;I'd run that code but it shows error in log window as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;22-322 Syntax error, expecting one of the following: !, !!, &amp;amp;, (, ), *, **, +, ',', -, '.', /, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND, EQ, EQT, EXCEPT, GE, GET, GT, GTT, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HAVING, IN, INTERSECT, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, OUTER, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNION, ^, ^=, |, ||, ~, ~=.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;68-185 The function CONTAINS is unknown, or cannot be accessed....... &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;plz help.....&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 09:48:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328348#M73310</guid>
      <dc:creator>bits</dc:creator>
      <dc:date>2017-01-30T09:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: create a new dataset based on certin keywords from existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328449#M73333</link>
      <description>&lt;P&gt;The contains operator can only be used in a datastep's where clause. However, you can accomplish the same thing with a series of statements that use the FIND function. Take a look at:&amp;nbsp;&lt;A href="http://support.sas.com/kb/43/303.html" target="_blank"&gt;http://support.sas.com/kb/43/303.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH,&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 14:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-dataset-based-on-certin-keywords-from-existing/m-p/328449#M73333</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-01-30T14:56:47Z</dc:date>
    </item>
  </channel>
</rss>

