<?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 delete a record depending on specific variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/how-to-delete-a-record-depending-on-specific-variable/m-p/754155#M29936</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/222563"&gt;@hjjijkkl&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a big data and I want to keep records where the term variable is either 0 or missing for that specific ID. For example in the table below, ID 2 has term=1 so, I want to delete the whole record for ID 2 from the data. How can I do that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So, I think your explanation needs clarification. In the first sentence, you want to keep records where term is either 0 or missing. Does that mean you want to keep just those records are either 0 or missing; or does that mean you want to keep the entire ID if you get a 0 or missing? Or does that mean something else?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your example where ID 2 has term=1, you want to delete it. What if there are mixed 0s and missings and 1s for term for an ID?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jul 2021 19:08:22 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-07-14T19:08:22Z</dc:date>
    <item>
      <title>how to delete a record depending on specific variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-delete-a-record-depending-on-specific-variable/m-p/754152#M29935</link>
      <description>&lt;P&gt;I have a big data and I want to keep records where the term variable is either 0 or missing for that specific ID. For example in the table below, ID 2 has term=1 so, I want to delete the whole record for ID 2 from the data. How can I do that?&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;D&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;term&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the outcome I want to have&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;D&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;term&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 14 Jul 2021 18:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-delete-a-record-depending-on-specific-variable/m-p/754152#M29935</guid>
      <dc:creator>hjjijkkl</dc:creator>
      <dc:date>2021-07-14T18:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a record depending on specific variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-delete-a-record-depending-on-specific-variable/m-p/754155#M29936</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/222563"&gt;@hjjijkkl&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a big data and I want to keep records where the term variable is either 0 or missing for that specific ID. For example in the table below, ID 2 has term=1 so, I want to delete the whole record for ID 2 from the data. How can I do that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So, I think your explanation needs clarification. In the first sentence, you want to keep records where term is either 0 or missing. Does that mean you want to keep just those records are either 0 or missing; or does that mean you want to keep the entire ID if you get a 0 or missing? Or does that mean something else?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your example where ID 2 has term=1, you want to delete it. What if there are mixed 0s and missings and 1s for term for an ID?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 19:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-delete-a-record-depending-on-specific-variable/m-p/754155#M29936</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-14T19:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a record depending on specific variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-delete-a-record-depending-on-specific-variable/m-p/754156#M29937</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/222563"&gt;@hjjijkkl&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a big data and I want to keep records where the term variable is either 0 or missing for that specific ID. For example in the table below, ID 2 has term=1 so, I want to delete the whole record for ID 2 from the data. How can I do that?&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;D&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;term&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the outcome I want to have&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;D&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;term&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="312"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="312"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select * from have
where D NOT IN (select distinct D from have where term=1);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jul 2021 19:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-delete-a-record-depending-on-specific-variable/m-p/754156#M29937</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-14T19:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a record depending on specific variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-delete-a-record-depending-on-specific-variable/m-p/754158#M29938</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/222563"&gt;@hjjijkkl&lt;/a&gt;&amp;nbsp; I just love these fun questions-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have ;
  infile cards truncover ;
  input ID $	term ;
cards ;
1	0
1	
2	1
2	
2	
3	.
3	
;

proc sql;
 create table want as
 select *
 from have
 group by id
 having not max(term) ;
quit;

proc print noobs ; run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.WANT" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l header" scope="col"&gt;ID&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;term&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;3&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;3&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Jul 2021 19:30:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-delete-a-record-depending-on-specific-variable/m-p/754158#M29938</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-07-14T19:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a record depending on specific variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-delete-a-record-depending-on-specific-variable/m-p/754160#M29939</link>
      <description>Breaks if you have no 1 in the data so not a really robust solution but meets minimal requirements &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Wed, 14 Jul 2021 19:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-delete-a-record-depending-on-specific-variable/m-p/754160#M29939</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-14T19:36:25Z</dc:date>
    </item>
  </channel>
</rss>

