<?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 Re: Selecting when criteria is met within a smaller time period in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Selecting-when-criteria-is-met-within-a-smaller-time-period/m-p/138496#M27947</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One pitfall to code around ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTCK will return a negative number when the first date is later than the second date.&amp;nbsp; You probably don't want all of those included in your count.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Sep 2014 15:38:24 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2014-09-10T15:38:24Z</dc:date>
    <item>
      <title>Selecting when criteria is met within a smaller time period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-when-criteria-is-met-within-a-smaller-time-period/m-p/138494#M27945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have data for one year that includes one date variable. There are many rows per individual. I need to be able to select individuals who satisfy three criteria within any 90 day period in the year. The dates are not equally spaced or the same for every individual. Any help would be greatly appreciated. This needs to be able to done in proc sql.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 13:26:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-when-criteria-is-met-within-a-smaller-time-period/m-p/138494#M27945</guid>
      <dc:creator>kwokramer</dc:creator>
      <dc:date>2014-09-10T13:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting when criteria is met within a smaller time period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-when-criteria-is-met-within-a-smaller-time-period/m-p/138495#M27946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;off the cuff...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;t1.individual,&lt;/P&gt;&lt;P&gt;t1.datevar,&lt;/P&gt;&lt;P&gt;count(*) as Occurrences&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; have t1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join have t2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on t1.individual = t2.individual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and intck('day',t1.datevar, t2.datevar) &amp;lt;=90&lt;/P&gt;&lt;P&gt;group by t1.individual, t1.datevar&lt;/P&gt;&lt;P&gt;having count(*)&amp;gt;=3;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 13:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-when-criteria-is-met-within-a-smaller-time-period/m-p/138495#M27946</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-09-10T13:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting when criteria is met within a smaller time period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-when-criteria-is-met-within-a-smaller-time-period/m-p/138496#M27947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One pitfall to code around ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTCK will return a negative number when the first date is later than the second date.&amp;nbsp; You probably don't want all of those included in your count.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 15:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-when-criteria-is-met-within-a-smaller-time-period/m-p/138496#M27947</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-09-10T15:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting when criteria is met within a smaller time period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-when-criteria-is-met-within-a-smaller-time-period/m-p/138497#M27948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would sorting after the initial data pull fix that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 15:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-when-criteria-is-met-within-a-smaller-time-period/m-p/138497#M27948</guid>
      <dc:creator>kwokramer</dc:creator>
      <dc:date>2014-09-10T15:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting when criteria is met within a smaller time period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-when-criteria-is-met-within-a-smaller-time-period/m-p/138498#M27949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorting wouldn't help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;t1.individual,&lt;/P&gt;&lt;P&gt;t1.datevar,&lt;/P&gt;&lt;P&gt;count(*) as Occurrences&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; have t1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join have t2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on t1.individual = t2.individual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and intck('day',t1.datevar, t2.datevar) &amp;lt;=90&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and t2.datevar &amp;gt;= t1.datevar&lt;/P&gt;&lt;P&gt;group by t1.individual, t1.datevar&lt;/P&gt;&lt;P&gt;having count(*)&amp;gt;=3;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 18:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-when-criteria-is-met-within-a-smaller-time-period/m-p/138498#M27949</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-09-10T18:25:44Z</dc:date>
    </item>
  </channel>
</rss>

