<?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 Finding the observations whose variable's values are the same as a specific observation in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Finding-the-observations-whose-variable-s-values-are-the-same-as/m-p/149980#M39545</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I want to create a subset from a dataset. Suppose I have a table like below. What I want to do is keeping all those observations with the same value of Class_ID as what student 1111 has. In this case, I want to create a subset of all observations that the values of their class_ID are equal to 22 or 33. &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="219"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="91"&gt;Student_ID&lt;/TD&gt;&lt;TD class="xl63" width="64"&gt;Class_ID&lt;/TD&gt;&lt;TD class="xl63" width="64"&gt;Score&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;1111&lt;/TD&gt;&lt;TD class="xl63"&gt;22&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;1111&lt;/TD&gt;&lt;TD class="xl63"&gt;33&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;2520&lt;/TD&gt;&lt;TD class="xl63"&gt;22&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;2520&lt;/TD&gt;&lt;TD class="xl63"&gt;44&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;5148&lt;/TD&gt;&lt;TD class="xl63"&gt;33&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;5148&lt;/TD&gt;&lt;TD class="xl63"&gt;66&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;6251&lt;/TD&gt;&lt;TD class="xl63"&gt;55&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate any suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Feb 2015 19:59:04 GMT</pubDate>
    <dc:creator>m1986MM</dc:creator>
    <dc:date>2015-02-02T19:59:04Z</dc:date>
    <item>
      <title>Finding the observations whose variable's values are the same as a specific observation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Finding-the-observations-whose-variable-s-values-are-the-same-as/m-p/149980#M39545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I want to create a subset from a dataset. Suppose I have a table like below. What I want to do is keeping all those observations with the same value of Class_ID as what student 1111 has. In this case, I want to create a subset of all observations that the values of their class_ID are equal to 22 or 33. &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="219"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="91"&gt;Student_ID&lt;/TD&gt;&lt;TD class="xl63" width="64"&gt;Class_ID&lt;/TD&gt;&lt;TD class="xl63" width="64"&gt;Score&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;1111&lt;/TD&gt;&lt;TD class="xl63"&gt;22&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;1111&lt;/TD&gt;&lt;TD class="xl63"&gt;33&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;2520&lt;/TD&gt;&lt;TD class="xl63"&gt;22&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;2520&lt;/TD&gt;&lt;TD class="xl63"&gt;44&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;5148&lt;/TD&gt;&lt;TD class="xl63"&gt;33&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;5148&lt;/TD&gt;&lt;TD class="xl63"&gt;66&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;6251&lt;/TD&gt;&lt;TD class="xl63"&gt;55&lt;/TD&gt;&lt;TD class="xl63"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate any suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 19:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Finding-the-observations-whose-variable-s-values-are-the-same-as/m-p/149980#M39545</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-02-02T19:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the observations whose variable's values are the same as a specific observation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Finding-the-observations-whose-variable-s-values-are-the-same-as/m-p/149981#M39546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where Class_id in (22,23);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Class_id is character then use ('22','23')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 20:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Finding-the-observations-whose-variable-s-values-are-the-same-as/m-p/149981#M39546</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-02-02T20:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the observations whose variable's values are the same as a specific observation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Finding-the-observations-whose-variable-s-values-are-the-same-as/m-p/149982#M39547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually the dataset is very large. So I can't easily find all values, like 22 or 33. I'm looking for an algorithm that can find all the values belonging to a certain student_ID, and then keep those observations that have the same value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 20:12:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Finding-the-observations-whose-variable-s-values-are-the-same-as/m-p/149982#M39547</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-02-02T20:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the observations whose variable's values are the same as a specific observation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Finding-the-observations-whose-variable-s-values-are-the-same-as/m-p/149983#M39548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This won't scale to larger data, you need to be more explicit to what your problem is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from have&lt;/P&gt;&lt;P&gt;where class_id in (select class_id from have where student_id = '1111');&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 20:17:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Finding-the-observations-whose-variable-s-values-are-the-same-as/m-p/149983#M39548</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-02T20:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the observations whose variable's values are the same as a specific observation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Finding-the-observations-whose-variable-s-values-are-the-same-as/m-p/149984#M39549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without further detail about what you are trying to do, my best suggestion would be the same as Reeza, assuming that for every case you know which student_id has the values you are looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 13:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Finding-the-observations-whose-variable-s-values-are-the-same-as/m-p/149984#M39549</guid>
      <dc:creator>SelsonMuniappen</dc:creator>
      <dc:date>2015-02-03T13:16:39Z</dc:date>
    </item>
  </channel>
</rss>

