<?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: Tough one: Search through repeated measures then delete. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248423#M56419</link>
    <description>&lt;P&gt;let me make it more concrete, as it's a bit complicated&lt;/P&gt;&lt;P&gt;We have a student whoes&amp;nbsp;has three majors Nursing, business, and fine art.&lt;/P&gt;&lt;P&gt;He was registered as a pre-nursing major first, and later converted into an actual nursing major, and then enrolled in second majors, third majors in business and fine art.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however, for whatever glitch we have in the system, it didn't delete his record of being a pre-nursing major, which will belong to University college. (Because if you are a pre-major you are not really in that major college yet).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In our system it show as following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Student ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Primary Major College &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;All major list &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Major College&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Nursing, business, fine art &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Health&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Nursing&lt;/SPAN&gt;&lt;SPAN&gt;, business, fine art &amp;nbsp;&lt;/SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;University College&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Nursing&lt;/SPAN&gt;&lt;SPAN&gt;, business, fine art &amp;nbsp;&lt;/SPAN&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Business&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Nursing&lt;/SPAN&gt;&lt;SPAN&gt;, business, fine art &amp;nbsp;&lt;/SPAN&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Fine Art&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;As you can see, the University college shows up because back in time he was a pre-major before.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;So, If I wanna find out students who has a major or all majors ONLY in college of health, this person will be rulled out, because he also belongs to business, and fine art. This is fine with this person. But if Another student has no other majors, but was once a pre-major, it would have shown as&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Student ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Primary Major College &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;All major list &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Major College&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Nursing, business, fine art &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Health&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Nursing&lt;/SPAN&gt;&lt;SPAN&gt;, business, fine art &amp;nbsp;&lt;/SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;University College&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this case, I want to still consider him as being college of Health. And I want to return only one row of Student IDs in the system.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2016 22:59:52 GMT</pubDate>
    <dc:creator>kksss</dc:creator>
    <dc:date>2016-02-05T22:59:52Z</dc:date>
    <item>
      <title>Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248412#M56411</link>
      <description>&lt;P&gt;I'm wrecking my brains on this one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data in the format of&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Student ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Majors &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;College&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; math &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Science&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Painting&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Fine Art&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 002 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Political science &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Social Science&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 002 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sociolgy &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Social Science&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; math &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Science&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Accounting&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Business&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;History &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Humanity&lt;/P&gt;&lt;P&gt;This is a dataset on the college a student's major belong to. E.g Student 002&amp;nbsp;&lt;/P&gt;&lt;P&gt;So some students will have multiple majors, and on the record it shows they blong to multiple college.&amp;nbsp;&lt;SPAN&gt;E.g Student 001 or student 003&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My ultimate purpose is to include/exclude&lt;/P&gt;&lt;P&gt;1) who only belongs to a certain college, no matter how many majors they have,&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) who has major in one certain college, e.g. science, but also has a major outside that college. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So my logic is to do a loop search based on their ID #, and then an "If then delete" statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I just can't seem to figure out how to proceed, and need some urgent help&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 21:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248412#M56411</guid>
      <dc:creator>kksss</dc:creator>
      <dc:date>2016-02-05T21:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248415#M56413</link>
      <description>&lt;P&gt;I believe I have the first part for you...&lt;/P&gt;&lt;P&gt;DATA OLD;&lt;BR /&gt;INPUT STUDENTID $1-3 MAJOR $ 23-40 COLLEGE $ 45-59;&lt;BR /&gt;DATALINES;&lt;BR /&gt;001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; math&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Science&lt;BR /&gt;001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Painting&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fine Art&lt;BR /&gt;002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Political science&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Social Science&lt;BR /&gt;002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sociolgy&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Social Science&lt;BR /&gt;003&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; math&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Science&lt;BR /&gt;003&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accounting&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Business&lt;BR /&gt;003&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; History&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Humanity&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;/*who only belongs to a certain college, no matter how many majors they have*/&lt;BR /&gt;DATA NEW1;SET OLD;&lt;BR /&gt;IF COLLEGE IN ("Science");&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 22:18:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248415#M56413</guid>
      <dc:creator>MelissaM</dc:creator>
      <dc:date>2016-02-05T22:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248420#M56417</link>
      <description>&lt;P&gt;Can you provide an example of how you want the results of the second requirement to appear? There are several ways to do this but the approach could depend on how you want the final data to appear.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 22:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248420#M56417</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-02-05T22:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248422#M56418</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/72032"&gt;@kksss&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) who only belongs to a certain college, no matter how many majors they have,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
select *
from have
where student_id in (
select student_id from have where student_id in(
select student_id from have group by student_id having count(distinct college) =1) 
and college ='Science');
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/72032"&gt;@kksss&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) who has major in one certain college, e.g. science, but also has a major outside that college. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
select *
from have 
where student_id  in 
(select distinct student_id 
 from have 
 where student_id in 
 (select distinct student_id from have where College='Social Science') 
 and College ~= 'Social Science'  );
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2016 01:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248422#M56418</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-02-06T01:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248423#M56419</link>
      <description>&lt;P&gt;let me make it more concrete, as it's a bit complicated&lt;/P&gt;&lt;P&gt;We have a student whoes&amp;nbsp;has three majors Nursing, business, and fine art.&lt;/P&gt;&lt;P&gt;He was registered as a pre-nursing major first, and later converted into an actual nursing major, and then enrolled in second majors, third majors in business and fine art.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however, for whatever glitch we have in the system, it didn't delete his record of being a pre-nursing major, which will belong to University college. (Because if you are a pre-major you are not really in that major college yet).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In our system it show as following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Student ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Primary Major College &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;All major list &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Major College&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Nursing, business, fine art &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Health&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Nursing&lt;/SPAN&gt;&lt;SPAN&gt;, business, fine art &amp;nbsp;&lt;/SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;University College&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Nursing&lt;/SPAN&gt;&lt;SPAN&gt;, business, fine art &amp;nbsp;&lt;/SPAN&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Business&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Nursing&lt;/SPAN&gt;&lt;SPAN&gt;, business, fine art &amp;nbsp;&lt;/SPAN&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Fine Art&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;As you can see, the University college shows up because back in time he was a pre-major before.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;So, If I wanna find out students who has a major or all majors ONLY in college of health, this person will be rulled out, because he also belongs to business, and fine art. This is fine with this person. But if Another student has no other majors, but was once a pre-major, it would have shown as&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Student ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Primary Major College &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;All major list &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Major College&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Nursing, business, fine art &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Health&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; College of Health &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Nursing&lt;/SPAN&gt;&lt;SPAN&gt;, business, fine art &amp;nbsp;&lt;/SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;University College&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this case, I want to still consider him as being college of Health. And I want to return only one row of Student IDs in the system.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 22:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248423#M56419</guid>
      <dc:creator>kksss</dc:creator>
      <dc:date>2016-02-05T22:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248424#M56420</link>
      <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;distinct&lt;/SPAN&gt; student_id &lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; have &lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt; College&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'Social Science'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; 
 and College &lt;SPAN class="token operator"&gt;~=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Social Science'&lt;/SPAN&gt;  &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Will this actually work? &amp;nbsp;You have a where condition that is contradiction.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 23:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248424#M56420</guid>
      <dc:creator>kksss</dc:creator>
      <dc:date>2016-02-05T23:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248425#M56421</link>
      <description>&lt;P&gt;Yes it will work. it is not contradiction. Change the college and you will see. This exclude who&amp;nbsp;has double major in the same college but not other college.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 23:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248425#M56421</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-02-05T23:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248428#M56422</link>
      <description>&lt;P&gt;Do you have dates attached to these records to help sort/identify the latest/timing of the situation?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2016 00:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248428#M56422</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-06T00:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248438#M56423</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
select distinct student_id from have where student_id in(
select student_id from have group by student_id having count(distinct college)=1) 
and college ='Science';
quit;

proc sql;
select distinct student_id from have where student_id in
(select distinct student_id from have where College='Science') 
 and College ~= 'Science' ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 06 Feb 2016 01:50:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248438#M56423</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-02-06T01:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248664#M56457</link>
      <description>&lt;P&gt;No, I don't have any dates on them. Gives me headache on this one&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 14:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248664#M56457</guid>
      <dc:creator>kksss</dc:creator>
      <dc:date>2016-02-08T14:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248711#M56464</link>
      <description>&lt;P&gt;Is the data provided to you in chonological order? If so, then attach an order variable of some sort before attempting to process.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 17:09:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248711#M56464</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-02-08T17:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Tough one: Search through repeated measures then delete.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248729#M56466</link>
      <description>&lt;P&gt;No there isn't it's ordered through A-Z.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 20:31:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tough-one-Search-through-repeated-measures-then-delete/m-p/248729#M56466</guid>
      <dc:creator>kksss</dc:creator>
      <dc:date>2016-02-08T20:31:10Z</dc:date>
    </item>
  </channel>
</rss>

