<?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: Looking at removed group in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/608037#M17616</link>
    <description>Thank you so much:)</description>
    <pubDate>Thu, 28 Nov 2019 12:05:52 GMT</pubDate>
    <dc:creator>Viktoreli</dc:creator>
    <dc:date>2019-11-28T12:05:52Z</dc:date>
    <item>
      <title>Looking at removed group</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/607698#M17585</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have a code where I remove &lt;STRONG&gt;all&lt;/STRONG&gt; observations with the same variable A when variable B is not the same number for that same A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=flag);
do until (last. a);
set have;
by a notsorted;
if first. a then _iorc_=b;
if _iorc_ ne b then flag=1;
end;
do until (last. a);
set have;
by a notsorted;
if not flag then output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now I want to look at the data I removed.&lt;/P&gt;&lt;P&gt;I want to remove all observations of variable A where the variable B only has a unqiue number for that A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A B&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;1 1 2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;2 1 2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;3 2 4&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;4 2 4&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;5 2 5&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;6 3 1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;7 4 2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;8 4 1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;1 2 4&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;2 2 4&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;3 2 5&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;4 4 2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;5 4 1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Help would be much appreciated!!:)&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 12:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/607698#M17585</guid>
      <dc:creator>Viktoreli</dc:creator>
      <dc:date>2019-11-28T12:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at removed group</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/607709#M17586</link>
      <description>&lt;P&gt;Please:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;post data in readily usable form (data step with datalines)&lt;/LI&gt;
&lt;LI&gt;test your code with this data before posting&lt;/LI&gt;
&lt;LI&gt;copy/paste the code &lt;EM&gt;directly&lt;/EM&gt; here&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I post this because your code, as posted, can never run.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/291193"&gt;@Viktoreli&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;I have a code where I remove &lt;STRONG&gt;all&lt;/STRONG&gt; observations with the same variable A when variable B is not not the same number for that same A.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=flag);
do until (last. a);
set have;
by a notsorted;
if first. a then _iorc_=ve;
if _iorc_ ne ve then flag=1;
end;
do until (last. a);
set have;
by a notsorted;
if not flag then output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now I want to look at the data I removed.&lt;/P&gt;
&lt;P&gt;I want to remove all observations of variable A where the variable B only has a unqiue number for that A.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A B&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;1 1 2&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;2 1 2&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;3 2 4&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;4 2 4&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;5 2 5&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;6 3 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;7 4 2&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;8 4 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A B&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;1 2 4&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;2 2 4&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;3 2 5&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;4 4 2&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;5 4 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Help would be much appreciated!!:)&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 14:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/607709#M17586</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-27T14:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at removed group</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/607711#M17587</link>
      <description>&lt;P&gt;It's easiest if you do it while you are separating out the observations you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want removed;
do until (last. a);
   set have;
   by a notsorted;
   if first. a then _iorc_=ve;
   if _iorc_ ne ve then flag=1;
end;
do until (last. a);
   set have;
   by a notsorted;
   if flag then output removed;
   else output want;
end;
drop flag;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This assumes that your original code was working properly to get the observations you want.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 14:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/607711#M17587</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-11-27T14:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at removed group</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/607721#M17588</link>
      <description>Thanks for your reply! Looked at my code and noticed mistakes when changing the names of the variables. I will try to follow your pointers in the future:)!</description>
      <pubDate>Wed, 27 Nov 2019 15:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/607721#M17588</guid>
      <dc:creator>Viktoreli</dc:creator>
      <dc:date>2019-11-27T15:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at removed group</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/607736#M17589</link>
      <description>What does 'is not not the same' mean?</description>
      <pubDate>Wed, 27 Nov 2019 15:37:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/607736#M17589</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2019-11-27T15:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at removed group</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/608036#M17615</link>
      <description>Good question:)</description>
      <pubDate>Thu, 28 Nov 2019 12:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/608036#M17615</guid>
      <dc:creator>Viktoreli</dc:creator>
      <dc:date>2019-11-28T12:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at removed group</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/608037#M17616</link>
      <description>Thank you so much:)</description>
      <pubDate>Thu, 28 Nov 2019 12:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Looking-at-removed-group/m-p/608037#M17616</guid>
      <dc:creator>Viktoreli</dc:creator>
      <dc:date>2019-11-28T12:05:52Z</dc:date>
    </item>
  </channel>
</rss>

