<?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 Delete first two years in a panel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Delete-first-two-years-in-a-panel/m-p/638563#M189905</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a panel dataset like below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input firmID $	Year	;
datalines;
A	1995	
A	1996	
A	1997	
A	1998	
B	1997	
B	1998	
B	1999	
B   2000
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would like to delete the first two years for each firm. The expected output is below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input firmID $	Year;
datalines;
A	1997	
A	1998	
B	1999	
B   2000
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What program do I need to use? Thanks!!&lt;/P&gt;</description>
    <pubDate>Thu, 09 Apr 2020 04:02:14 GMT</pubDate>
    <dc:creator>dapenDaniel</dc:creator>
    <dc:date>2020-04-09T04:02:14Z</dc:date>
    <item>
      <title>Delete first two years in a panel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-first-two-years-in-a-panel/m-p/638563#M189905</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a panel dataset like below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input firmID $	Year	;
datalines;
A	1995	
A	1996	
A	1997	
A	1998	
B	1997	
B	1998	
B	1999	
B   2000
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would like to delete the first two years for each firm. The expected output is below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input firmID $	Year;
datalines;
A	1997	
A	1998	
B	1999	
B   2000
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What program do I need to use? Thanks!!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2020 04:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-first-two-years-in-a-panel/m-p/638563#M189905</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2020-04-09T04:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Delete first two years in a panel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-first-two-years-in-a-panel/m-p/638565#M189907</link>
      <description>&lt;P&gt;Use a counter with by-group processing, and a subsetting if:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by firmid;
if first.firmid
then counter = 1;
else counter + 1;
if counter &amp;gt; 2;
drop counter;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Apr 2020 04:08:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-first-two-years-in-a-panel/m-p/638565#M189907</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-09T04:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Delete first two years in a panel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-first-two-years-in-a-panel/m-p/638584#M189912</link>
      <description>Thanks!</description>
      <pubDate>Thu, 09 Apr 2020 05:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-first-two-years-in-a-panel/m-p/638584#M189912</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2020-04-09T05:07:24Z</dc:date>
    </item>
  </channel>
</rss>

