<?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: Identifying ids with a certain missing value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471969#M120943</link>
    <description>&lt;P&gt;Thank you, mkeintz! In my dataset, there are many ids with multiple instances of class='A' but that's helpful code to know for the future. Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jun 2018 03:08:40 GMT</pubDate>
    <dc:creator>SarahW13</dc:creator>
    <dc:date>2018-06-21T03:08:40Z</dc:date>
    <item>
      <title>Identifying ids with a certain missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471952#M120933</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question about how to identify individuals that are missing a certain value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp; class&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this dataset, id 3 is the only one that does not have any class value of A. I would like to identify all individuals that do not have a class value of A. Can anyone guide me how to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 00:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471952#M120933</guid>
      <dc:creator>SarahW13</dc:creator>
      <dc:date>2018-06-21T00:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying ids with a certain missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471954#M120935</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID    class $;
cards;
1        A
1        B
1        C
2        A
2        B
3        B
3        C
;
run;

data want;
set have;
by id;
retain _class found;
if first.id then found=.;
_class='A';
if class=_class then found=1;
if last.id and not found;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jun 2018 00:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471954#M120935</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-21T00:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying ids with a certain missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471956#M120936</link>
      <description>&lt;P&gt;More cleaner&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by id;
retain _class 'A' found;
if first.id then found=.;
if class=_class then found=1;
if last.id and not found;
drop _class found;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jun 2018 00:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471956#M120936</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-21T00:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying ids with a certain missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471957#M120937</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 00:47:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471957#M120937</guid>
      <dc:creator>SarahW13</dc:creator>
      <dc:date>2018-06-21T00:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying ids with a certain missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471958#M120938</link>
      <description>&lt;P&gt;If each id has exactly zero or one instance of class='A' then a compact way to do this is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  merge have (where=(class='A') in=afound)  have;
  by id;
  flag=afound;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edited additional note. &amp;nbsp; This program&amp;nbsp; will also works for ID's with multiple class A records. &lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 04:09:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471958#M120938</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-06-21T04:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying ids with a certain missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471969#M120943</link>
      <description>&lt;P&gt;Thank you, mkeintz! In my dataset, there are many ids with multiple instances of class='A' but that's helpful code to know for the future. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 03:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/471969#M120943</guid>
      <dc:creator>SarahW13</dc:creator>
      <dc:date>2018-06-21T03:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying ids with a certain missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/472098#M120991</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id       class $;
cards;
1        A
1        B
1        C
2        A
2        B
3        B
3        C
;
run;
proc sql;
select *
 from have
  group by id
   having sum(class='A')=0;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jun 2018 13:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-ids-with-a-certain-missing-value/m-p/472098#M120991</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-06-21T13:56:49Z</dc:date>
    </item>
  </channel>
</rss>

