<?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: Delete rown based on criteria BUT field has both numeric and variable d in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Delete-rown-based-on-criteria-BUT-field-has-both-numeric-and/m-p/22100#M4786</link>
    <description>I should have used AND.&lt;BR /&gt;
Problem solved!&lt;BR /&gt;
Thanks for your time.</description>
    <pubDate>Wed, 22 Apr 2009 16:59:16 GMT</pubDate>
    <dc:creator>osho</dc:creator>
    <dc:date>2009-04-22T16:59:16Z</dc:date>
    <item>
      <title>Delete rown based on criteria BUT field has both numeric and variable data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delete-rown-based-on-criteria-BUT-field-has-both-numeric-and/m-p/22097#M4783</link>
      <description>I have a field which has numeric and string data. The values are 1,2,3....10 and 'RP" and 'EX'.&lt;BR /&gt;
&lt;BR /&gt;
goal: I want to keep only 1 and 2 and delete others.&lt;BR /&gt;
&lt;BR /&gt;
When I use the following code, it gives me the following error.&lt;BR /&gt;
&lt;BR /&gt;
code:if status_inventory ne 1 or status_inventory ne 2  then delete;&lt;BR /&gt;
error: if status_inventory ne 1 or status_inventory ne 2  then delete;&lt;BR /&gt;
&lt;BR /&gt;
when i use the code by considering it as string data, it deletes all the rows.&lt;BR /&gt;
&lt;BR /&gt;
any creative ways to handle this?</description>
      <pubDate>Wed, 22 Apr 2009 16:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delete-rown-based-on-criteria-BUT-field-has-both-numeric-and/m-p/22097#M4783</guid>
      <dc:creator>osho</dc:creator>
      <dc:date>2009-04-22T16:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rown based on criteria BUT field has both numeric and variable data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delete-rown-based-on-criteria-BUT-field-has-both-numeric-and/m-p/22098#M4784</link>
      <description>For future reference, it is usually best to include the actual code and the actual error message for clarity.  &lt;BR /&gt;
&lt;BR /&gt;
With that said and assuming that I understand the problem &lt;BR /&gt;
&lt;BR /&gt;
    If status_inventory is a character variable ( and I assume this to be true since you state it can take on the values 1,2,3...10, RP and EX) then your IF statement must put the 1 and 2 in quotes as follows&lt;BR /&gt;
&lt;BR /&gt;
   if status_inventory ne '1' or status_inventory ne '2' then delete</description>
      <pubDate>Wed, 22 Apr 2009 16:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delete-rown-based-on-criteria-BUT-field-has-both-numeric-and/m-p/22098#M4784</guid>
      <dc:creator>LAP</dc:creator>
      <dc:date>2009-04-22T16:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rown based on criteria BUT field has both numeric and variable d</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delete-rown-based-on-criteria-BUT-field-has-both-numeric-and/m-p/22099#M4785</link>
      <description>When I do that, it deletes everything. It is a character variable.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data temp4;&lt;BR /&gt;
set temp4;&lt;BR /&gt;
if status_inventory ne '1' or status_inventory ne '2'  then delete;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
deletes all rows, even when status_inventory takes value 1 and 2</description>
      <pubDate>Wed, 22 Apr 2009 16:36:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delete-rown-based-on-criteria-BUT-field-has-both-numeric-and/m-p/22099#M4785</guid>
      <dc:creator>osho</dc:creator>
      <dc:date>2009-04-22T16:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rown based on criteria BUT field has both numeric and variable d</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delete-rown-based-on-criteria-BUT-field-has-both-numeric-and/m-p/22100#M4786</link>
      <description>I should have used AND.&lt;BR /&gt;
Problem solved!&lt;BR /&gt;
Thanks for your time.</description>
      <pubDate>Wed, 22 Apr 2009 16:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delete-rown-based-on-criteria-BUT-field-has-both-numeric-and/m-p/22100#M4786</guid>
      <dc:creator>osho</dc:creator>
      <dc:date>2009-04-22T16:59:16Z</dc:date>
    </item>
  </channel>
</rss>

