<?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: finding observations in the month before a specific date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/finding-observations-in-the-month-before-a-specific-date/m-p/305479#M65168</link>
    <description>&lt;P&gt;Use function INTCK with option "CONTINUOUS" to get the number of months :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
months = intck("MONTH", proc_date, hosp_date, "CONTINUOUS");
run;

proc sort data=want; by months id proc_date; run;

proc print data=want; 
by months; id months;
var id proc_date  proc_type   hosp_date;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 18 Oct 2016 18:26:12 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-10-18T18:26:12Z</dc:date>
    <item>
      <title>finding observations in the month before a specific date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-observations-in-the-month-before-a-specific-date/m-p/305443#M65161</link>
      <description>&lt;P&gt;I am trying to summarize observations that occur in the month prior to specific&amp;nbsp;date and create another summary to observations that occurred&amp;nbsp;two months before the same date and so on. &amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;id proc_date  proc_type   hosp_date 
1     11/13/2005   a              12/1/2005
1      10/13/2005  a              12/1/2005 
2       2/3/2004     b               3/1/2004
2       1/14/2004   c                3/1/2004&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;each id has one hosp_day but multiple proc_date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output I am looking is&amp;nbsp;&lt;/P&gt;&lt;P&gt;during 1 months pre hosp_date would include;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;id proc_date  proc_type   hosp_date 
1     11/13/2005   a              12/1/2005
2       2/3/2004     b               3/1/2004&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;during the 2 months pre hosp_dae would include:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;id proc_date  proc_type   hosp_date 
1      10/13/2005  a              12/1/2005 
2       1/14/2004   c                3/1/2004&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Oct 2016 17:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-observations-in-the-month-before-a-specific-date/m-p/305443#M65161</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2016-10-18T17:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: finding observations in the month before a specific date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-observations-in-the-month-before-a-specific-date/m-p/305479#M65168</link>
      <description>&lt;P&gt;Use function INTCK with option "CONTINUOUS" to get the number of months :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
months = intck("MONTH", proc_date, hosp_date, "CONTINUOUS");
run;

proc sort data=want; by months id proc_date; run;

proc print data=want; 
by months; id months;
var id proc_date  proc_type   hosp_date;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Oct 2016 18:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-observations-in-the-month-before-a-specific-date/m-p/305479#M65168</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-10-18T18:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: finding observations in the month before a specific date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-observations-in-the-month-before-a-specific-date/m-p/305533#M65182</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 20:56:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-observations-in-the-month-before-a-specific-date/m-p/305533#M65182</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2016-10-18T20:56:45Z</dc:date>
    </item>
  </channel>
</rss>

