<?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: Unable to delete records. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-delete-records/m-p/876990#M346447</link>
    <description>&lt;P&gt;If this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if amount=o then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is really your code, then the log will most probably tell you that variable o is uninitialized, unless o is also contained in dataset have.&lt;/P&gt;</description>
    <pubDate>Tue, 23 May 2023 05:18:29 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-05-23T05:18:29Z</dc:date>
    <item>
      <title>Unable to delete records.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-delete-records/m-p/876960#M346432</link>
      <description>&lt;P&gt;I have amount columns as below, few amount column is 0(Zero) values, and some are more than Zero. I do not want Zero values from amount column. proc contents as below.&lt;/P&gt;
&lt;TABLE class="table" aria-label="Variables"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;#&lt;/TH&gt;
&lt;TH class="b header" scope="col"&gt;Variable&lt;/TH&gt;
&lt;TH class="b header" scope="col"&gt;Type&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Len&lt;/TH&gt;
&lt;TH class="b header" scope="col"&gt;Format&lt;/TH&gt;
&lt;TH class="b header" scope="col"&gt;Informat&lt;/TH&gt;
&lt;TH class="b header" scope="col"&gt;Label&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="data"&gt;amount&lt;/TD&gt;
&lt;TD class="data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="data"&gt;18.&lt;/TD&gt;
&lt;TD class="data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I am using as below, still I see amount 0 is there in output and not deleting. May I know what I am missing here in condition.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;if amount=o then delete;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 19:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-delete-records/m-p/876960#M346432</guid>
      <dc:creator>kumarsandip975</dc:creator>
      <dc:date>2023-05-22T19:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to delete records.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-delete-records/m-p/876965#M346435</link>
      <description>&lt;P&gt;Your example code does not have a zero in it.&amp;nbsp; Instead it has a lowercase letter O.&lt;/P&gt;
&lt;P&gt;Try using zero instead.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  if amount=0 then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If that still show some values as zero then perhaps they are between -0.5 and 0.5 since you asked SAS to display the values as integers by attaching the display format of 18. to the variable.&lt;/P&gt;
&lt;P&gt;Try using the ROUND() function to round the value to an integer before comparing it to zero.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  if round(amount,1)=0 then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or perhaps you should display the values with a different format so you can see if they have something other then zero there that you might want to keep?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have;
  tables amount ;
  format amount best18.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 May 2023 20:20:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-delete-records/m-p/876965#M346435</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-22T20:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to delete records.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-delete-records/m-p/876990#M346447</link>
      <description>&lt;P&gt;If this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if amount=o then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is really your code, then the log will most probably tell you that variable o is uninitialized, unless o is also contained in dataset have.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 05:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-delete-records/m-p/876990#M346447</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-05-23T05:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to delete records.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-delete-records/m-p/876996#M346452</link>
      <description>&lt;P&gt;o was typo, I mean if amount=0 then delete;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 06:34:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-delete-records/m-p/876996#M346452</guid>
      <dc:creator>kumarsandip975</dc:creator>
      <dc:date>2023-05-23T06:34:20Z</dc:date>
    </item>
  </channel>
</rss>

