<?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 How to keep only those observations which are in both pre and post events window in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-keep-only-those-observations-which-are-in-both-pre-and/m-p/560100#M156529</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am new to SAS!&lt;/P&gt;&lt;P&gt;Actually, I was trying to limit my sample into those firms only which have data for both pre and post events in my sample. The event years are different for different firms. For instance, if event year of one firm is 2006, I want to see whether this firm has data for the previous five years and post five years or not. I don't want the firms to be having data for each of the pre-and post years. eve observation from pre- and one from post- would suffice my purpose. But they should have at least one in each if they don't then I want to delete those firms from my sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Data look like:&lt;/P&gt;&lt;P&gt;Cusip Year Sales event_year&lt;/P&gt;&lt;P&gt;11000 2005 10&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;11000&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2006&amp;nbsp; 20&amp;nbsp; 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;11000 2007&amp;nbsp; 30&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;11000 2008&amp;nbsp; 40&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;12000&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2004&lt;/STRONG&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;65&amp;nbsp; 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;12000 2005&amp;nbsp; 90&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;12000 2006&amp;nbsp; 65&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;13000 2010&amp;nbsp; 80&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;13000 2011&amp;nbsp; 75&amp;nbsp; 0&amp;nbsp;&lt;/P&gt;&lt;P&gt;13000&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2012&amp;nbsp; 95&amp;nbsp; 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;14000 2008&amp;nbsp; 65&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;14000 2009&amp;nbsp; 45&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;14000&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2010&amp;nbsp; 70&amp;nbsp; 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;14000 2011&amp;nbsp; 90&amp;nbsp; 0&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The years in bold are my event years, different for different firms. So according to the criteria, I don't want cusip codes 13000 and 12000 because they don't have data for either pre- or post event years. Please help me with the code!&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aman&lt;/P&gt;</description>
    <pubDate>Mon, 20 May 2019 11:31:58 GMT</pubDate>
    <dc:creator>amanjot_42</dc:creator>
    <dc:date>2019-05-20T11:31:58Z</dc:date>
    <item>
      <title>How to keep only those observations which are in both pre and post events window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-keep-only-those-observations-which-are-in-both-pre-and/m-p/560100#M156529</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am new to SAS!&lt;/P&gt;&lt;P&gt;Actually, I was trying to limit my sample into those firms only which have data for both pre and post events in my sample. The event years are different for different firms. For instance, if event year of one firm is 2006, I want to see whether this firm has data for the previous five years and post five years or not. I don't want the firms to be having data for each of the pre-and post years. eve observation from pre- and one from post- would suffice my purpose. But they should have at least one in each if they don't then I want to delete those firms from my sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Data look like:&lt;/P&gt;&lt;P&gt;Cusip Year Sales event_year&lt;/P&gt;&lt;P&gt;11000 2005 10&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;11000&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2006&amp;nbsp; 20&amp;nbsp; 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;11000 2007&amp;nbsp; 30&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;11000 2008&amp;nbsp; 40&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;12000&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2004&lt;/STRONG&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;65&amp;nbsp; 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;12000 2005&amp;nbsp; 90&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;12000 2006&amp;nbsp; 65&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;13000 2010&amp;nbsp; 80&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;13000 2011&amp;nbsp; 75&amp;nbsp; 0&amp;nbsp;&lt;/P&gt;&lt;P&gt;13000&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2012&amp;nbsp; 95&amp;nbsp; 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;14000 2008&amp;nbsp; 65&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;14000 2009&amp;nbsp; 45&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;14000&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2010&amp;nbsp; 70&amp;nbsp; 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;14000 2011&amp;nbsp; 90&amp;nbsp; 0&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The years in bold are my event years, different for different firms. So according to the criteria, I don't want cusip codes 13000 and 12000 because they don't have data for either pre- or post event years. Please help me with the code!&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aman&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 11:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-keep-only-those-observations-which-are-in-both-pre-and/m-p/560100#M156529</guid>
      <dc:creator>amanjot_42</dc:creator>
      <dc:date>2019-05-20T11:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to keep only those observations which are in both pre and post events window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-keep-only-those-observations-which-are-in-both-pre-and/m-p/560133#M156542</link>
      <description>&lt;P&gt;See my answer in the related thread&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Observations-in-pre-and-post-events-only/m-p/560105" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Observations-in-pre-and-post-events-only/m-p/560105&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 13:44:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-keep-only-those-observations-which-are-in-both-pre-and/m-p/560133#M156542</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-20T13:44:01Z</dc:date>
    </item>
  </channel>
</rss>

