<?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: Identify rows based on two conditions in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Identify-rows-based-on-two-conditions/m-p/717731#M9716</link>
    <description>&lt;P&gt;The important part may be more in the realm of how many events?&lt;/P&gt;
&lt;P&gt;Is your Score variable numeric or character? I have to ask because there are different approaches available for different types of data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you just want the ID's of interest or are there other variables that need to be in the output?&lt;/P&gt;
&lt;P&gt;It is always a good idea to show the desired output should look like.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Feb 2021 20:38:47 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-02-08T20:38:47Z</dc:date>
    <item>
      <title>Identify rows based on two conditions</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Identify-rows-based-on-two-conditions/m-p/717720#M9715</link>
      <description>&lt;P&gt;I have data of something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID EVENT SCORE&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I care about scores not matching for an ID. That is IDs 3 and 4 would be of interest. Is there a way to view only those IDs keeping in mind that my actual dataset has many more IDs than this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 20:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Identify-rows-based-on-two-conditions/m-p/717720#M9715</guid>
      <dc:creator>amarikow57</dc:creator>
      <dc:date>2021-02-08T20:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Identify rows based on two conditions</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Identify-rows-based-on-two-conditions/m-p/717731#M9716</link>
      <description>&lt;P&gt;The important part may be more in the realm of how many events?&lt;/P&gt;
&lt;P&gt;Is your Score variable numeric or character? I have to ask because there are different approaches available for different types of data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you just want the ID's of interest or are there other variables that need to be in the output?&lt;/P&gt;
&lt;P&gt;It is always a good idea to show the desired output should look like.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 20:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Identify-rows-based-on-two-conditions/m-p/717731#M9716</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-08T20:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Identify rows based on two conditions</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Identify-rows-based-on-two-conditions/m-p/717742#M9717</link>
      <description>&lt;P&gt;I have around 8 events in total, but only 2 of the events contain the scores I am interested in. These are stored as numeric.&lt;/P&gt;&lt;P&gt;Ideally I want my dataset to contain the single score available and the matching scores. To decide what to do with the scores that are different, I want to be able to view those ID observations and decide from there if they are something to keep.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 21:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Identify-rows-based-on-two-conditions/m-p/717742#M9717</guid>
      <dc:creator>amarikow57</dc:creator>
      <dc:date>2021-02-08T21:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Identify rows based on two conditions</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Identify-rows-based-on-two-conditions/m-p/717748#M9718</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/352503"&gt;@amarikow57&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have around 8 events in total, but only 2 of the events contain the scores I am interested in. These are stored as numeric.&lt;/P&gt;
&lt;P&gt;Ideally I want my dataset to contain the single score available and the matching scores. To decide what to do with the scores that are different, I want to be able to view those ID observations and decide from there if they are something to keep.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Doesn't quite tell me how you expect the output, and brings up the need for an example with up to 8 events, such as how do we know which scores for which events are of interest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would be tempted to start with something like this to identify the mismatches:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc summary data=have nway;
   class id;
   var score;
   output out=summary(drop=_: where=(score_range ne 0 or score_nmiss&amp;gt;0) )
      min= max= range= nmiss= /autoname;
   ;
run;&lt;/PRE&gt;
&lt;P&gt;Range is the largest value - lowest, so if not equal to 0 then there is a difference for a numeric variable.&lt;/P&gt;
&lt;P&gt;However when you have missing the Range only uses non-missing values so wouldn't catch the ones with missing. So this also counts the number of Nmiss, missing , values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 21:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Identify-rows-based-on-two-conditions/m-p/717748#M9718</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-08T21:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Identify rows based on two conditions</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Identify-rows-based-on-two-conditions/m-p/717875#M9721</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID EVENT SCORE;
cards;
1   1           3
1   2           3
2   1           7
2   2           7
3   1           8
3   2           6
4   1           .
4   2           5
;
proc sql;
create table want as
select *
 from have
  group by id
   having count(distinct score) &amp;gt; 1 or ( n(score) and nmiss(score))
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Feb 2021 12:08:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Identify-rows-based-on-two-conditions/m-p/717875#M9721</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-02-09T12:08:43Z</dc:date>
    </item>
  </channel>
</rss>

