<?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: Weekly counts based on  start and end dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361268#M85174</link>
    <description>&lt;P&gt;This isn't difficult, but we really need to hear more from you to define the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is "your table" already a SAS data set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your date variable a character string or does it hold numeric SAS date values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know how to get the report you want for each day individually, without grouping by week?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What else should the report contain?&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2017 16:49:13 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-05-24T16:49:13Z</dc:date>
    <item>
      <title>Weekly counts based on  start and end dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361265#M85172</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to do counts on a weekly basis beginning from&amp;nbsp;2016/03/01 to present date of all accounts from my table.&lt;/P&gt;&lt;P&gt;My table contains dates with the original date format of DDMONYYYY but I want the output layout to be in weekly format:&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g. Sun, Feb 28, 2016 to Sat, Mar 5, 2016 and so on.. Can someone help me out, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;TD-A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 16:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361265#M85172</guid>
      <dc:creator>TD-A</dc:creator>
      <dc:date>2017-05-24T16:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Weekly counts based on  start and end dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361268#M85174</link>
      <description>&lt;P&gt;This isn't difficult, but we really need to hear more from you to define the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is "your table" already a SAS data set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your date variable a character string or does it hold numeric SAS date values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know how to get the report you want for each day individually, without grouping by week?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What else should the report contain?&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 16:49:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361268#M85174</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-24T16:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Weekly counts based on  start and end dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361275#M85177</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, my table is a SAS dataset.&lt;/P&gt;&lt;P&gt;My date variable is already in date format: date9.&lt;/P&gt;&lt;P&gt;Yes, I have a query to get the counts that I want, it’s the grouping by week I’m struggling with.&lt;/P&gt;&lt;P&gt;Basically, it will just contain weeks,&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;Week &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Vol attrition &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; transfers to pbi &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; transfers out of pbi&lt;/P&gt;&lt;P&gt;week1: &amp;nbsp;2016-02-28 to 2016-03-05 &amp;nbsp; &amp;nbsp;# of accts attrition &amp;nbsp; # of transfer to pbi &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # of transfer out of pbi&lt;/P&gt;&lt;P&gt;week2: 2016-03-06 to 2016-03-12&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;# of accts attrition &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;# of transfer to pbi &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # of transfer out of pbi&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and so on..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 17:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361275#M85177</guid>
      <dc:creator>TD-A</dc:creator>
      <dc:date>2017-05-24T17:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Weekly counts based on  start and end dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361278#M85178</link>
      <description>&lt;P&gt;OK, here's a way to set up a format that can be used to group:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data format_me;&lt;/P&gt;
&lt;P&gt;fmtname = 'MyWeeks';&lt;/P&gt;
&lt;P&gt;do week=1 to 500;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; start = '28feb2016'd + (week-1) * 7;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; end = start + 6;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; label = put(start, yymmdd10.) || ' to ' || put(end, yymmdd10.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;proc format cntlin=format_me;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gives you a format with 500 weeks defined, that you can apply to your summarization process.&amp;nbsp; Depending on what that part of the program looks like you might be using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;format your_date_variable_name myweeks.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But to get more specific than that, I'd need to see how you summarize the data to get your report.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 17:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361278#M85178</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-24T17:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Weekly counts based on  start and end dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361340#M85192</link>
      <description>&lt;P&gt;Thanks, Astounding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I was able to set the weeks from week1 to current week from the format you sent below, but I can't incorporate it with my table.&lt;/P&gt;&lt;P&gt;My main table contains account (#s), dates from when they were extracted (daily), status (active, etc) and product name.&lt;/P&gt;&lt;P&gt;I want to count the # of accounts per week based on the formatted weeks below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Weeks &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# of Accts (VOL)&lt;/P&gt;&lt;P&gt;Week1: 02/28/2016 - 03/05/2016 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and so on..&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 19:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361340#M85192</guid>
      <dc:creator>TD-A</dc:creator>
      <dc:date>2017-05-24T19:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Weekly counts based on  start and end dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361346#M85196</link>
      <description>&lt;P&gt;You might have to show the SAS log.&amp;nbsp; It's a little difficult to visualize what's happening here without it.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 19:23:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/361346#M85196</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-24T19:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Weekly counts based on  start and end dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/362691#M85701</link>
      <description>&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't use the week format since there are lots of weeks that don't have counts so i used the specific dates instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 12:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weekly-counts-based-on-start-and-end-dates/m-p/362691#M85701</guid>
      <dc:creator>TD-A</dc:creator>
      <dc:date>2017-05-30T12:30:57Z</dc:date>
    </item>
  </channel>
</rss>

