<?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 choosing the first date and last date in a dataset in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/choosing-the-first-date-and-last-date-in-a-dataset/m-p/12396#M1648</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; This is perfect! exactly what I needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Dec 2011 11:16:46 GMT</pubDate>
    <dc:creator>coba</dc:creator>
    <dc:date>2011-12-13T11:16:46Z</dc:date>
    <item>
      <title>choosing the first date and last date in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/choosing-the-first-date-and-last-date-in-a-dataset/m-p/12393#M1645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the code suggested in one of the answers as I want to get the first and last date of a country.&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;data get_first_and_last;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;&amp;nbsp; set master_table;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;&amp;nbsp; by ID Date;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;&amp;nbsp; if first.date or last.Date then output;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;However, I still get the dates in between and I'm replacint ID by country &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;I have the following observations&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt; &lt;/STRONG&gt;&lt;STRONG style="font-size: 13px;"&gt;country&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;&lt;STRONG style="font-size: 13px;"&gt;countrya&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01jan00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;countrya&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01feb00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;countrya&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01feb00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;countrya&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01mar00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;etc ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;&lt;STRONG style="font-size: 13px;"&gt;countrya&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01nov11&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;How do I get only the country and&amp;nbsp; 01jan00 and 01nov11? Is there any other way. I have a lot of observations&amp;nbsp; and variables and I only choose the country and the date that is why I have repeated dates.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt;Thank you&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2011 16:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/choosing-the-first-date-and-last-date-in-a-dataset/m-p/12393#M1645</guid>
      <dc:creator>coba</dc:creator>
      <dc:date>2011-12-12T16:17:57Z</dc:date>
    </item>
    <item>
      <title>choosing the first date and last date in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/choosing-the-first-date-and-last-date-in-a-dataset/m-p/12394#M1646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change two lines in your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&lt;STRONG&gt;&amp;nbsp; by ID;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&lt;STRONG&gt;&amp;nbsp; if first.ID or last.ID then output;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2011 16:47:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/choosing-the-first-date-and-last-date-in-a-dataset/m-p/12394#M1646</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-12T16:47:07Z</dc:date>
    </item>
    <item>
      <title>choosing the first date and last date in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/choosing-the-first-date-and-last-date-in-a-dataset/m-p/12395#M1647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;informat date date7.;&lt;/P&gt;&lt;P&gt;format date date7.;&lt;/P&gt;&lt;P&gt;input country $ date;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;countrya&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01jan00&lt;/P&gt;&lt;P&gt;countrya&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01feb00&lt;/P&gt;&lt;P&gt;countrya&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01feb00&lt;/P&gt;&lt;P&gt;countrya&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01mar00&lt;/P&gt;&lt;P&gt;countrya&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01nov11&lt;/P&gt;&lt;P&gt;countryb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01jan00&lt;/P&gt;&lt;P&gt;countryb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01feb00&lt;/P&gt;&lt;P&gt;countryb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01feb00&lt;/P&gt;&lt;P&gt;countryb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01mar00&lt;/P&gt;&lt;P&gt;countryb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01nov11&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc sort; by country date;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by country;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.country or last.country;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 04:20:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/choosing-the-first-date-and-last-date-in-a-dataset/m-p/12395#M1647</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2011-12-13T04:20:46Z</dc:date>
    </item>
    <item>
      <title>choosing the first date and last date in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/choosing-the-first-date-and-last-date-in-a-dataset/m-p/12396#M1648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; This is perfect! exactly what I needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 11:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/choosing-the-first-date-and-last-date-in-a-dataset/m-p/12396#M1648</guid>
      <dc:creator>coba</dc:creator>
      <dc:date>2011-12-13T11:16:46Z</dc:date>
    </item>
  </channel>
</rss>

