<?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 question on &amp;quot;Finding the First or Last Observation in a Group&amp;quot; in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/question-on-quot-Finding-the-First-or-Last-Observation-in-a/m-p/22082#M4774</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; It works. Thanks a lot!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Jan 2012 03:06:38 GMT</pubDate>
    <dc:creator>helensh</dc:creator>
    <dc:date>2012-01-02T03:06:38Z</dc:date>
    <item>
      <title>question on "Finding the First or Last Observation in a Group"</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-quot-Finding-the-First-or-Last-Observation-in-a/m-p/22080#M4772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I follow the steps provided in the following website &lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001349233.htm"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001349233.htm&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=Gta2 Out=Gta3;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; by Agmtcd;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data sub_Gta3;&lt;BR /&gt;set Gta3;&lt;BR /&gt;by Agmtcd;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data sub_Gta3;&lt;BR /&gt;set Gta3;&lt;BR /&gt;FirstAgmtcd=first.Agmtcd;&lt;BR /&gt;LastAgmtcd=last.Agmtcd;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, SAS says the variables "first.Agmtcd" and "last.Agmtcd" are not initialized. The format of Agmtcd is $10. Does anybody know what's wrong with my code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Dec 2011 16:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-quot-Finding-the-First-or-Last-Observation-in-a/m-p/22080#M4772</guid>
      <dc:creator>helensh</dc:creator>
      <dc:date>2011-12-31T16:28:21Z</dc:date>
    </item>
    <item>
      <title>question on "Finding the First or Last Observation in a Group"</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-quot-Finding-the-First-or-Last-Observation-in-a/m-p/22081#M4773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have 3 datasteps when you should only have 2.&amp;nbsp; The first. and last. variables are only available when a by statement is present within the SAME datastep.&amp;nbsp; Thus, try it with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;proc sort data=Gta2 Out=Gta3;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; by Agmtcd;&lt;BR /&gt;run;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&lt;BR /&gt;data sub_Gta3;&lt;BR /&gt;&amp;nbsp; set Gta3;&lt;BR /&gt;&amp;nbsp; by Agmtcd;FirstAgmtcd=first.Agmtcd;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; LastAgmtcd=last.Agmtcd;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Dec 2011 16:33:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-quot-Finding-the-First-or-Last-Observation-in-a/m-p/22081#M4773</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-31T16:33:52Z</dc:date>
    </item>
    <item>
      <title>question on "Finding the First or Last Observation in a Group"</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-quot-Finding-the-First-or-Last-Observation-in-a/m-p/22082#M4774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; It works. Thanks a lot!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2012 03:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-quot-Finding-the-First-or-Last-Observation-in-a/m-p/22082#M4774</guid>
      <dc:creator>helensh</dc:creator>
      <dc:date>2012-01-02T03:06:38Z</dc:date>
    </item>
  </channel>
</rss>

