<?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: exclude conditional records in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828051#M327095</link>
    <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Aug 2022 10:04:39 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-08-10T10:04:39Z</dc:date>
    <item>
      <title>exclude conditional records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828034#M327089</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want records that are 0 before 1 and should not delete 0 after 1, how can I proceed?&lt;/P&gt;
&lt;P&gt;Please check below data.&lt;/P&gt;
&lt;TABLE tabindex="0" width="195px" data-is-focusable="true"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="47.75px" height="57px"&gt;&lt;SPAN&gt;sub&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="98.4792px" height="57px"&gt;&lt;SPAN&gt;dt&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="47.75px" height="31px" align="right"&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="98.4792px" height="31px" align="right"&gt;&lt;SPAN&gt;3/8/2022&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="47.7708px" height="31px" align="right"&gt;&lt;FONT color="#333333"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="47.75px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="98.4792px" height="30px" align="right"&gt;&lt;SPAN&gt;3/9/2022&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="47.7708px" height="30px" align="right"&gt;&lt;FONT color="#333333"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="47.75px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="98.4792px" height="30px" align="right"&gt;&lt;SPAN&gt;3/10/2022&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="47.7708px" height="30px" align="right"&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="47.75px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="98.4792px" height="30px" align="right"&gt;&lt;SPAN&gt;3/11/2022&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="47.7708px" height="30px" align="right"&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="47.75px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="98.4792px" height="30px" align="right"&gt;&lt;SPAN&gt;3/12/2022&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="47.7708px" height="30px" align="right"&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 07:21:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828034#M327089</guid>
      <dc:creator>KalaBhairava</dc:creator>
      <dc:date>2022-08-10T07:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: exclude conditional records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828035#M327090</link>
      <description>&lt;P&gt;Do you want to keep or delete records with 0 before 1?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want this logic to work by ID (sub) ?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 07:26:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828035#M327090</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-08-10T07:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: exclude conditional records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828037#M327091</link>
      <description>&lt;P&gt;either way, delete or flagging both are fine&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 07:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828037#M327091</guid>
      <dc:creator>KalaBhairava</dc:creator>
      <dc:date>2022-08-10T07:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: exclude conditional records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828040#M327092</link>
      <description>&lt;P&gt;I think this is what you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added an extra sub to make it suitable for by group processing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input sub dt :mmddyy10. dummy;
format dt mmddyy10.;
datalines; 
1 3/8/2022  0
1 3/9/2022  0
1 3/10/2022 1
1 3/11/2022 1
1 3/12/2022 0
2 3/8/2022  0
2 3/9/2022  0
2 3/10/2022 1
2 3/11/2022 1
2 3/12/2022 0
;

data want;
   set have;
   by sub;
   if first.sub then _iorc_ = 0;
   if dummy then _iorc_ = 1;
   if _iorc_;
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;sub  dt          dummy
1    03/10/2022  1 
1    03/11/2022  1 
1    03/12/2022  0 
2    03/10/2022  1 
2    03/11/2022  1 
2    03/12/2022  0 &lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Aug 2022 07:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828040#M327092</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-08-10T07:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: exclude conditional records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828050#M327094</link>
      <description>&lt;P&gt;Thank you very much and it's working well.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 10:03:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828050#M327094</guid>
      <dc:creator>KalaBhairava</dc:creator>
      <dc:date>2022-08-10T10:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: exclude conditional records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828051#M327095</link>
      <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 10:04:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828051#M327095</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-08-10T10:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: exclude conditional records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828412#M327246</link>
      <description>Can you give me code to flags those records with 0 before 1?</description>
      <pubDate>Fri, 12 Aug 2022 05:47:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exclude-conditional-records/m-p/828412#M327246</guid>
      <dc:creator>KalaBhairava</dc:creator>
      <dc:date>2022-08-12T05:47:29Z</dc:date>
    </item>
  </channel>
</rss>

