<?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: Deleting observations based on a full end-to-end event in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Deleting-observations-based-on-a-full-end-to-end-event/m-p/640585#M21748</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/267739"&gt;@Bounce&lt;/a&gt;&amp;nbsp; Assuming you are having 5 distinct events,&amp;nbsp;&lt;SPAN&gt;would it be easy to filter the count of distinct events=5 -&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input (id date) ($) event &amp;amp; $20.;
cards;
1 01012000 Kindergarten
1 01012001 Preschool
1 01012003 Primary
1 01012010 High School
2 01012000 Primary
2 01012010 High School
3 01012009 Kindergarten
3 01012010 Preschool
3 01012012 Primary
3 01012019 High School
3 01012024 University
;

run;

proc sql;
create table want as
select *
from have
group by id
having count(distinct event)=5;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2020 23:51:07 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-04-16T23:51:07Z</dc:date>
    <item>
      <title>Deleting observations based on a full end-to-end event</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Deleting-observations-based-on-a-full-end-to-end-event/m-p/640579#M21747</link>
      <description>&lt;P&gt;Hello SAS community,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a dataset with 3 rows: ID, Date, Event. ID and Date are pretty self-explanatory but event contains different education phases for each ID: Kindergarten, Preschool, Primary, High School and University. Now obviously, not everyone will have completed every stage of this education (or I might be missing their data).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;But how can I retain only the IDs who have data with every single Event (end-to-end)? For instance, in the below mock data, I want my final dataset to be in the exact same format but containing only ID 3 since it has *all* stages of the Events and ID 1 and 2 are missing certain Events.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data I have:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input id date event;&lt;/P&gt;&lt;P&gt;1 01012000 Kindergarten&lt;/P&gt;&lt;P&gt;1 01012001 Preschool&lt;/P&gt;&lt;P&gt;1 01012003 Primary&lt;/P&gt;&lt;P&gt;1 01012010 High School&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 01012000 Primary&lt;/P&gt;&lt;P&gt;2 01012010 High School&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3 01012009 Kindergarten&lt;/P&gt;&lt;P&gt;3 01012010 Preschool&lt;/P&gt;&lt;P&gt;3 01012012 Primary&lt;/P&gt;&lt;P&gt;3 01012019 High School&lt;/P&gt;&lt;P&gt;3 01012024 University&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your kind help SAS community.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 22:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Deleting-observations-based-on-a-full-end-to-end-event/m-p/640579#M21747</guid>
      <dc:creator>Bounce</dc:creator>
      <dc:date>2020-04-16T22:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting observations based on a full end-to-end event</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Deleting-observations-based-on-a-full-end-to-end-event/m-p/640585#M21748</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/267739"&gt;@Bounce&lt;/a&gt;&amp;nbsp; Assuming you are having 5 distinct events,&amp;nbsp;&lt;SPAN&gt;would it be easy to filter the count of distinct events=5 -&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input (id date) ($) event &amp;amp; $20.;
cards;
1 01012000 Kindergarten
1 01012001 Preschool
1 01012003 Primary
1 01012010 High School
2 01012000 Primary
2 01012010 High School
3 01012009 Kindergarten
3 01012010 Preschool
3 01012012 Primary
3 01012019 High School
3 01012024 University
;

run;

proc sql;
create table want as
select *
from have
group by id
having count(distinct event)=5;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 23:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Deleting-observations-based-on-a-full-end-to-end-event/m-p/640585#M21748</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-04-16T23:51:07Z</dc:date>
    </item>
  </channel>
</rss>

