<?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: How to conditionally delete datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-delete-datasets/m-p/786874#M251286</link>
    <description>Similar to your earlier question, you can use:&lt;BR /&gt;&lt;BR /&gt;if drug='abc' or ns_n;</description>
    <pubDate>Tue, 21 Dec 2021 00:19:29 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2021-12-21T00:19:29Z</dc:date>
    <item>
      <title>How to conditionally delete datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-delete-datasets/m-p/786853#M251272</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to delete observations that have ns_n ='.' or 0 but leave the rows that have a certain value of drug= 'abc' (which intrinsically has ns_n equal to '.' and 0; they have other values - uns_n and sns_n instead).&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use this code below all rows containing ns_n ='.' or 0 are deleted including the data with drug 'abc' and I need to keep them:&lt;/P&gt;&lt;P&gt;Data DB_test;&lt;BR /&gt;set AB_2020;&lt;BR /&gt;if ns_n='.' then delete;&lt;BR /&gt;if ns_n =0 then delete;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 22:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-delete-datasets/m-p/786853#M251272</guid>
      <dc:creator>mayasak</dc:creator>
      <dc:date>2021-12-20T22:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to conditionally delete datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-delete-datasets/m-p/786854#M251273</link>
      <description>&lt;P&gt;First of all, one of your statements is wrong and works only because SAS does an automatic type conversion for you. Relying on this is considered bad practice.&lt;/P&gt;
&lt;P&gt;Assuming your variable is numeric, do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if drug ne 'abc' and ns_n in (0,.) then delete;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Dec 2021 22:30:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-delete-datasets/m-p/786854#M251273</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-12-20T22:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to conditionally delete datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-delete-datasets/m-p/786874#M251286</link>
      <description>Similar to your earlier question, you can use:&lt;BR /&gt;&lt;BR /&gt;if drug='abc' or ns_n;</description>
      <pubDate>Tue, 21 Dec 2021 00:19:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-delete-datasets/m-p/786874#M251286</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-12-21T00:19:29Z</dc:date>
    </item>
  </channel>
</rss>

