<?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: Removing variables in a table with a missing value, but only for certain observations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-variables-in-a-table-with-a-missing-value-but-only-for/m-p/550418#M152816</link>
    <description>&lt;P&gt;The condition&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;and TRMT1 and TRMT2="00"&lt;/SPAN&gt;&lt;/STRONG&gt; means: ... and TRMT1=1 and TRMT2="00"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which I believe you didn't mean to.&lt;/P&gt;
&lt;P&gt;You want&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;to remove observation that has date but both trmt1 and trmt2 have 0 value&lt;/SPAN&gt;&lt;/STRONG&gt;,&lt;/P&gt;
&lt;P&gt;so the correct code is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if datetx NE . and TRMT1=0  and TRMT2=0 then delete;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Pay attention to the note in the log:&lt;/P&gt;
&lt;PRE&gt;NOTE: Character values have been converted to numeric values &lt;/PRE&gt;
&lt;P&gt;you did not post the whole log. I suppose the the "00" were converted to 0, assuming TRMT1 and TRMT2, both are numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2019 20:44:06 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2019-04-11T20:44:06Z</dc:date>
    <item>
      <title>Removing variables in a table with a missing value, but only for certain observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-variables-in-a-table-with-a-missing-value-but-only-for/m-p/550349#M152795</link>
      <description>&lt;P&gt;hello, i have data set like this&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;DATETX&lt;/TD&gt;&lt;TD&gt;TRMT1&lt;/TD&gt;&lt;TD&gt;TRMT2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/3/2019&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/7/2019&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01/22/2019&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02/15/2019&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;i would like to remove observation that has date but both trmt1 and trmt2 have 0 value.&lt;/P&gt;&lt;P&gt;i used this code:&lt;/P&gt;&lt;P&gt;data janfebs.JAN2FEB2019_MERGED_T_1;&lt;BR /&gt;set janfebs.JAN2FEB2019_MERGED_T;&lt;BR /&gt;if datetx NE . and TRMT1 and TRMT2="00" then delete;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;but it did not work. the log says&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: Character values have been converted to numeric values at the places given by:&lt;BR /&gt;(Line):(Column).&lt;BR /&gt;436:20&lt;BR /&gt;NOTE: There were 702 observations read from the data set JANFEBS.JAN2FEB2019_MERGED_T.&lt;BR /&gt;NOTE: The data set JANFEBS.JAN2FEB2019_MERGED_T_1 has 691 observations and 256 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.11 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;i originally had 702 observations.&lt;/P&gt;&lt;P&gt;and the result shows same as before observation with 0 values are not removed.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;DATETX&lt;/TD&gt;&lt;TD&gt;TRMT1&lt;/TD&gt;&lt;TD&gt;TRMT2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/3/2019&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/7/2019&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01/22/2019&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02/15/2019&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;please help.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 17:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-variables-in-a-table-with-a-missing-value-but-only-for/m-p/550349#M152795</guid>
      <dc:creator>Dhana18</dc:creator>
      <dc:date>2019-04-11T17:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Removing variables in a table with a missing value, but only for certain observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-variables-in-a-table-with-a-missing-value-but-only-for/m-p/550352#M152797</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;&amp;nbsp;i would like to remove observation that has date but both trmt1 and trmt2 have 0 value."&lt;/SPAN&gt;&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 want;

set have;

if sum(trmt1,trmt2)&amp;gt;0;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To include Datetx in your condition&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if datetx &amp;gt;. and sum(trmt1,trmt2)&amp;gt;0;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Apr 2019 17:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-variables-in-a-table-with-a-missing-value-but-only-for/m-p/550352#M152797</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-04-11T17:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Removing variables in a table with a missing value, but only for certain observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-variables-in-a-table-with-a-missing-value-but-only-for/m-p/550418#M152816</link>
      <description>&lt;P&gt;The condition&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;and TRMT1 and TRMT2="00"&lt;/SPAN&gt;&lt;/STRONG&gt; means: ... and TRMT1=1 and TRMT2="00"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which I believe you didn't mean to.&lt;/P&gt;
&lt;P&gt;You want&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;to remove observation that has date but both trmt1 and trmt2 have 0 value&lt;/SPAN&gt;&lt;/STRONG&gt;,&lt;/P&gt;
&lt;P&gt;so the correct code is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if datetx NE . and TRMT1=0  and TRMT2=0 then delete;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Pay attention to the note in the log:&lt;/P&gt;
&lt;PRE&gt;NOTE: Character values have been converted to numeric values &lt;/PRE&gt;
&lt;P&gt;you did not post the whole log. I suppose the the "00" were converted to 0, assuming TRMT1 and TRMT2, both are numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 20:44:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-variables-in-a-table-with-a-missing-value-but-only-for/m-p/550418#M152816</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-04-11T20:44:06Z</dc:date>
    </item>
  </channel>
</rss>

