<?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 order and count in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/order-and-count/m-p/771957#M31018</link>
    <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;Dear, I have not been able to solve the following problem, hopefully you can help me. I have an ID with associated dates, and I need to sort the data by ID, descending date and count these records one by one. for instance: the table I have&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Andres_Fuentes1_0-1633364693835.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64348iDA9AB36AD52A70F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Andres_Fuentes1_0-1633364693835.png" alt="Andres_Fuentes1_0-1633364693835.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;and this is the result that I should get.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Andres_Fuentes1_1-1633364800590.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64349i6B27690887B1D9BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Andres_Fuentes1_1-1633364800590.png" alt="Andres_Fuentes1_1-1633364800590.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Oct 2021 16:27:16 GMT</pubDate>
    <dc:creator>Andres_Fuentes1</dc:creator>
    <dc:date>2021-10-04T16:27:16Z</dc:date>
    <item>
      <title>order and count</title>
      <link>https://communities.sas.com/t5/New-SAS-User/order-and-count/m-p/771957#M31018</link>
      <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;Dear, I have not been able to solve the following problem, hopefully you can help me. I have an ID with associated dates, and I need to sort the data by ID, descending date and count these records one by one. for instance: the table I have&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Andres_Fuentes1_0-1633364693835.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64348iDA9AB36AD52A70F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Andres_Fuentes1_0-1633364693835.png" alt="Andres_Fuentes1_0-1633364693835.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;and this is the result that I should get.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Andres_Fuentes1_1-1633364800590.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64349i6B27690887B1D9BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Andres_Fuentes1_1-1633364800590.png" alt="Andres_Fuentes1_1-1633364800590.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 16:27:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/order-and-count/m-p/771957#M31018</guid>
      <dc:creator>Andres_Fuentes1</dc:creator>
      <dc:date>2021-10-04T16:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: order and count</title>
      <link>https://communities.sas.com/t5/New-SAS-User/order-and-count/m-p/771962#M31019</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
by ID descending date;
run;

data want;
set have;
by id descending date;

if first.id then number_order=1;
else number_order+1;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/faq/how-can-i-create-an-enumeration-variable-by-groups/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/faq/how-can-i-create-an-enumeration-variable-by-groups/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/386950"&gt;@Andres_Fuentes1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;Dear, I have not been able to solve the following problem, hopefully you can help me. I have an ID with associated dates, and I need to sort the data by ID, descending date and count these records one by one. for instance: the table I have&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Andres_Fuentes1_0-1633364693835.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64348iDA9AB36AD52A70F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Andres_Fuentes1_0-1633364693835.png" alt="Andres_Fuentes1_0-1633364693835.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;and this is the result that I should get.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Andres_Fuentes1_1-1633364800590.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64349i6B27690887B1D9BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Andres_Fuentes1_1-1633364800590.png" alt="Andres_Fuentes1_1-1633364800590.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 16:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/order-and-count/m-p/771962#M31019</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-04T16:30:56Z</dc:date>
    </item>
  </channel>
</rss>

