<?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 Just a short question about removing rows in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Just-a-short-question-about-removing-rows/m-p/844470#M36688</link>
    <description>&lt;P&gt;Closed&lt;/P&gt;</description>
    <pubDate>Tue, 15 Nov 2022 19:59:38 GMT</pubDate>
    <dc:creator>hellorc</dc:creator>
    <dc:date>2022-11-15T19:59:38Z</dc:date>
    <item>
      <title>Just a short question about removing rows</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Just-a-short-question-about-removing-rows/m-p/844470#M36688</link>
      <description>&lt;P&gt;Closed&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 19:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Just-a-short-question-about-removing-rows/m-p/844470#M36688</guid>
      <dc:creator>hellorc</dc:creator>
      <dc:date>2022-11-15T19:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Just a short question about removing rows</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Just-a-short-question-about-removing-rows/m-p/844472#M36689</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input patient_id week condition @@;
datalines;
1 1 0 
1 2 1 
1 3 3 
2 2 2 
2 5 1 
3 1 3 
4 2 0 
4 3 1 
4 4 1 
4 5 2 
;
run;

data want(drop = flag);
   set have;
   by patient_id;
   if first.patient_id then flag = 0;
   if flag = 0 then output;
   if condition = 1 then flag = 1;
   retain flag;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Result:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;patient_id week condition
1          1    0
1          2    1
2          2    2
2          5    1
3          1    3
4          2    0
4          3    1&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 19:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Just-a-short-question-about-removing-rows/m-p/844472#M36689</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-11-15T19:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Just a short question about removing rows</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Just-a-short-question-about-removing-rows/m-p/844473#M36690</link>
      <description>&lt;P&gt;Nothing is easy. : )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you show the code you have tried?&amp;nbsp; Did it involve RETAIN?&amp;nbsp; That will help others help you.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 19:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Just-a-short-question-about-removing-rows/m-p/844473#M36690</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2022-11-15T19:41:18Z</dc:date>
    </item>
  </channel>
</rss>

