<?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: How to get week1 week2 week3 week4 based on date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-week1-week2-week3-week4-based-on-date/m-p/273287#M54444</link>
    <description>&lt;P&gt;Seems like what you want is&amp;nbsp;to extract the day of the month, divide that by 7 and take the ceiling of the result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;DayMo = Day(Date);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WeekMo = ceil(DayMo/7);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But that would get you week3 for January 16, not week2&lt;/P&gt;</description>
    <pubDate>Thu, 26 May 2016 15:08:39 GMT</pubDate>
    <dc:creator>Haris</dc:creator>
    <dc:date>2016-05-26T15:08:39Z</dc:date>
    <item>
      <title>How to get week1 week2 week3 week4 based on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-week1-week2-week3-week4-based-on-date/m-p/273280#M54441</link>
      <description>Hi I have a table that has a date column I need to determine what week out of the month was it week1 week2 week3 week4...enclose is a sample of what I have an what I need it to look&lt;BR /&gt;&lt;BR /&gt;Id. Date&lt;BR /&gt;A1. 01/01/16&lt;BR /&gt;A2. 01/16/16&lt;BR /&gt;A1. 01/26/16&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Want&lt;BR /&gt;Id. Date. Week&lt;BR /&gt;A1. 01/01/16. Week1&lt;BR /&gt;A2. 01/16/16. Week2&lt;BR /&gt;A1. 01/26/16. Week4&lt;BR /&gt;&lt;BR /&gt;thanks in advance</description>
      <pubDate>Thu, 26 May 2016 14:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-week1-week2-week3-week4-based-on-date/m-p/273280#M54441</guid>
      <dc:creator>Beto16</dc:creator>
      <dc:date>2016-05-26T14:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get week1 week2 week3 week4 based on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-week1-week2-week3-week4-based-on-date/m-p/273282#M54442</link>
      <description>&lt;P&gt;There are, believe it or not,&amp;nbsp;several of definitons for "week" when it comes to use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does your "week" start on Sunday, Monday or some other day? Or is week the first 7 days of a month regardless of starting day of the week?&lt;/P&gt;
&lt;P&gt;Does it count as week one if there is only one day in that week? 2 days? 3 days?&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 14:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-week1-week2-week3-week4-based-on-date/m-p/273282#M54442</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-26T14:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get week1 week2 week3 week4 based on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-week1-week2-week3-week4-based-on-date/m-p/273287#M54444</link>
      <description>&lt;P&gt;Seems like what you want is&amp;nbsp;to extract the day of the month, divide that by 7 and take the ceiling of the result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;DayMo = Day(Date);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WeekMo = ceil(DayMo/7);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But that would get you week3 for January 16, not week2&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 15:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-week1-week2-week3-week4-based-on-date/m-p/273287#M54444</guid>
      <dc:creator>Haris</dc:creator>
      <dc:date>2016-05-26T15:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get week1 week2 week3 week4 based on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-week1-week2-week3-week4-based-on-date/m-p/273358#M54471</link>
      <description>&lt;P&gt;The definition is pretty critical as you are saying that 1/16/2016 is in week 2 bu tis the 3rd Saturday of January 2016 while 1/1/2016 is in week 1 as the first Friday. So are the dates between 3 and 9 january week 1 or week2?&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 18:56:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-week1-week2-week3-week4-based-on-date/m-p/273358#M54471</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-26T18:56:30Z</dc:date>
    </item>
  </channel>
</rss>

