<?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: Getting SAS to recognize weeks in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28225#M6557</link>
    <description>So. Now im at a new standstill..&lt;BR /&gt;
&lt;BR /&gt;
Is there anyway to redefine the week() function, so that the week starts every monday?</description>
    <pubDate>Mon, 08 Nov 2010 13:10:43 GMT</pubDate>
    <dc:creator>TMorville</dc:creator>
    <dc:date>2010-11-08T13:10:43Z</dc:date>
    <item>
      <title>Getting SAS to recognize weeks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28221#M6553</link>
      <description>Hello everyone.&lt;BR /&gt;
&lt;BR /&gt;
I have a dataset with approx 15000 observations, that all have a date marking like "13MAY2010" but distributed over several months.&lt;BR /&gt;
&lt;BR /&gt;
What i would like SAS to do, is to recognize each date, and then give a new variable called "week" the weeknumber. An example could be, that 13MAY2010 would be marked with "23" because its the 23 week of 2010.&lt;BR /&gt;
&lt;BR /&gt;
I've googled all morning and searched though the forum with no luck. &lt;BR /&gt;
&lt;BR /&gt;
Thanks a bunch!</description>
      <pubDate>Thu, 04 Nov 2010 10:06:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28221#M6553</guid>
      <dc:creator>TMorville</dc:creator>
      <dc:date>2010-11-04T10:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Getting SAS to recognize weeks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28222#M6554</link>
      <description>Hm, I might be missing something but I think this is fairly simple, ie. I would create a new variable in a data step:&lt;BR /&gt;
&lt;BR /&gt;
data new; set old;&lt;BR /&gt;
wn=week(mydate);&lt;BR /&gt;
&lt;BR /&gt;
Now, to me 13MAY2010 would indicate week # 19, but I guess it depends on if the week starts on a Sunday or a Monday...&lt;BR /&gt;
&lt;BR /&gt;
Cheers!</description>
      <pubDate>Thu, 04 Nov 2010 10:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28222#M6554</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-11-04T10:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Getting SAS to recognize weeks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28223#M6555</link>
      <description>Ha!&lt;BR /&gt;
&lt;BR /&gt;
That did work. Simple enough. Thanks!</description>
      <pubDate>Thu, 04 Nov 2010 10:54:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28223#M6555</guid>
      <dc:creator>TMorville</dc:creator>
      <dc:date>2010-11-04T10:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Getting SAS to recognize weeks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28224#M6556</link>
      <description>Yess! You made my day - I was able to help someone &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Thu, 04 Nov 2010 10:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28224#M6556</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-11-04T10:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Getting SAS to recognize weeks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28225#M6557</link>
      <description>So. Now im at a new standstill..&lt;BR /&gt;
&lt;BR /&gt;
Is there anyway to redefine the week() function, so that the week starts every monday?</description>
      <pubDate>Mon, 08 Nov 2010 13:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28225#M6557</guid>
      <dc:creator>TMorville</dc:creator>
      <dc:date>2010-11-08T13:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Getting SAS to recognize weeks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28226#M6558</link>
      <description>Hello TMorville,&lt;BR /&gt;
&lt;BR /&gt;
SAS help says that it is necessary to use "V" or "W" descriptor to switch to Monday, say:&lt;BR /&gt;
&lt;BR /&gt;
Week("01Feb2010"d,"W");&lt;BR /&gt;
&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Mon, 08 Nov 2010 15:48:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-SAS-to-recognize-weeks/m-p/28226#M6558</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-11-08T15:48:37Z</dc:date>
    </item>
  </channel>
</rss>

