<?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: Summarizing or Expanding Data into Weeks in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245934#M45957</link>
    <description>&lt;P&gt;I think Proc Expand can do what you want, do you have SAS/ETS licensed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/PROC-EXPAND-daily-to-weekly-aggregation-with-missing-values/td-p/212201" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/PROC-EXPAND-daily-to-weekly-aggregation-with-missing-values/td-p/212201&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jan 2016 18:14:31 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-01-25T18:14:31Z</dc:date>
    <item>
      <title>Summarizing or Expanding Data into Weeks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245919#M45949</link>
      <description>&lt;P&gt;Good Morning,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following data below (first 10 observations).&lt;/P&gt;&lt;P&gt;Enrolled Frequency&lt;/P&gt;&lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;06/02/2014&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/09/2014&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/16/2014&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/17/2014&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/18/2014&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/20/2014&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/21/2014&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/22/2014&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/27/2014&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/28/2014&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I need to&amp;nbsp;convert the total frequency into weeks with cumulative summary of enrolled:&lt;/P&gt;&lt;P&gt;Week &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Enrolled&lt;/P&gt;&lt;P&gt;6/2/2014 &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;6/9/2014 &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;10/6/2014 &amp;nbsp;1&lt;/P&gt;&lt;P&gt;10/13/2014 3&lt;/P&gt;&lt;P&gt;10/20/2014 16&lt;/P&gt;&lt;P&gt;10/27/2014 &amp;nbsp;23&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2016 17:47:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245919#M45949</guid>
      <dc:creator>coco1908</dc:creator>
      <dc:date>2016-01-25T17:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing or Expanding Data into Weeks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245922#M45951</link>
      <description>&lt;P&gt;I'm not following how you're doing the translation between days/weeks. Can you please expand your example.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2016 17:49:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245922#M45951</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-25T17:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing or Expanding Data into Weeks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245923#M45952</link>
      <description>&lt;P&gt;I need to convert the frequency into a cumulative frequency by weeks of the year.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2016 17:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245923#M45952</guid>
      <dc:creator>coco1908</dc:creator>
      <dc:date>2016-01-25T17:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing or Expanding Data into Weeks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245930#M45954</link>
      <description>I still need to collapse this into weeks though to get the second part of my question.</description>
      <pubDate>Mon, 25 Jan 2016 17:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245930#M45954</guid>
      <dc:creator>coco1908</dc:creator>
      <dc:date>2016-01-25T17:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing or Expanding Data into Weeks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245933#M45956</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
format date week mmddyy10.;
input date mmddyy10. enroll;
week = intnx('week',date,0,'begin')+1;
cards;
06/02/2014	1
10/09/2014	2
10/16/2014	4
10/17/2014	3
10/18/2014	1
10/20/2014	5
10/21/2014	2
10/22/2014	1
10/27/2014	4
10/28/2014	1
;
run;
data want(drop=i rc date enroll);
if _n_ = 1 then do;
	if 0 then set have;
	declare hash h (dataset:'have',multidata&amp;amp;colon;'y');
	h.definekey('week');
	h.definedata('enroll');
	h.definedone();
end;
call missing (of _all_);
do date = '01jan2014'd to '31dec2014'd by 7;
	week = intnx('week',date,0,'begin')+1;
	rc=h.find();
	do i = 1 to 10 while (rc=0);
		enroll_tot + enroll;
		rc=h.find_next();
	end;
	output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jan 2016 18:58:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245933#M45956</guid>
      <dc:creator>DanZ</dc:creator>
      <dc:date>2016-01-25T18:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing or Expanding Data into Weeks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245934#M45957</link>
      <description>&lt;P&gt;I think Proc Expand can do what you want, do you have SAS/ETS licensed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/PROC-EXPAND-daily-to-weekly-aggregation-with-missing-values/td-p/212201" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/PROC-EXPAND-daily-to-weekly-aggregation-with-missing-values/td-p/212201&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2016 18:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarizing-or-Expanding-Data-into-Weeks/m-p/245934#M45957</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-25T18:14:31Z</dc:date>
    </item>
  </channel>
</rss>

