<?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: mark for each ID the first row where condition... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/mark-for-each-ID-the-first-row-where-condition/m-p/764134#M242008</link>
    <description>&lt;P&gt;You can apply the same mechanisms I gave you in your &lt;A href="https://communities.sas.com/t5/SAS-Programming/Calculate-first-month-of-LEFT-Nethisha/td-p/764121/jump-to/first-unread-message" target="_blank" rel="noopener"&gt;other question&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Aug 2021 09:11:56 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-08-26T09:11:56Z</dc:date>
    <item>
      <title>mark for each ID the first row where condition...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mark-for-each-ID-the-first-row-where-condition/m-p/764132#M242006</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In step 1 I want to add a new columns&amp;nbsp; called Ind_First_Row_Y_ne_Null.&lt;/P&gt;
&lt;P&gt;It will get binary value 1 /0.&lt;/P&gt;
&lt;P&gt;I want to know for each ID where is the first row where Y is not null.&lt;/P&gt;
&lt;P&gt;Wanted data set&amp;nbsp; in step1 is&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ronein_0-1629967175566.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63044i5C94434F5D066080/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ronein_0-1629967175566.png" alt="Ronein_0-1629967175566.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;What is the way to get it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then in step 2 I want to delete for each ID all rows that are before&amp;nbsp;First_Row_Y_ne_Null=1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In step 3 I want for each ID to mark the first row where month=. (Null)&lt;/P&gt;
&lt;P&gt;Step 3 should be done from data sets that was created in step 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the way to do it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
INPUT ID month Y;
cards;
1 2101 .
1 2102 .
1 2103 .
1 2104 10
1 2105 20
1 2106 30
1 2107 40
1 2108 50
2 2101 10
2 2102 15
2 2103 20
2 2104 30
2 2105 20
2 2106 50
2 2107 50
2 2108 40
3 2101 10
3 2102 15
3 2103 20
3 2104 .
3 2105 .
3 2106 .
3 2107 .
3 2108 .
4 2101 10
4 2102 15
4 2103 .
4 2104 .
4 2105 10
4 2106 15
4 2107 20
4 2108 15
;
Run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 08:42:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mark-for-each-ID-the-first-row-where-condition/m-p/764132#M242006</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-08-26T08:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: mark for each ID the first row where condition...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mark-for-each-ID-the-first-row-where-condition/m-p/764134#M242008</link>
      <description>&lt;P&gt;You can apply the same mechanisms I gave you in your &lt;A href="https://communities.sas.com/t5/SAS-Programming/Calculate-first-month-of-LEFT-Nethisha/td-p/764121/jump-to/first-unread-message" target="_blank" rel="noopener"&gt;other question&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 09:11:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mark-for-each-ID-the-first-row-where-condition/m-p/764134#M242008</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-26T09:11:56Z</dc:date>
    </item>
  </channel>
</rss>

