<?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: Week function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913163#M359928</link>
    <description>&lt;P&gt;According to the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n1ka2ulrvrjlasn0z7beco2yrgas.htm" target="_blank" rel="noopener"&gt;WEEK function doc&lt;/A&gt; the 'V' option counts from 1. The U and W options start from 0. As I already mentioned the V option does the ISO definition.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jan 2024 21:14:01 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2024-01-26T21:14:01Z</dc:date>
    <item>
      <title>Week function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913026#M359883</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to get the real number of the week. Do I need to use week(Date,'v') ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 18:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913026#M359883</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2024-01-25T18:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Week function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913032#M359885</link>
      <description>&lt;P&gt;You could use&amp;nbsp;&lt;SPAN&gt;week(Date,'v') or&amp;nbsp;week(Date,'w') or&amp;nbsp;week(Date,'u'), whichever works for you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 18:51:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913032#M359885</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-01-25T18:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Week function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913033#M359886</link>
      <description>&lt;P&gt;What do you mean by "real number of the week"? There are different recognised definitions for week number and you need to decide which one to use. The SAS doc explains the definitions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a link to the ISO definition of week number (week date):&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/ISO_week_date" target="_blank"&gt;https://en.wikipedia.org/wiki/ISO_week_date&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SAS 'V' method gives the ISO definition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 19:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913033#M359886</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-01-25T19:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Week function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913035#M359888</link>
      <description>&lt;P&gt;One of the best skills a SAS user can develop is flexible use of the internet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A search (using duckduckgo) for&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;sas week function 9.4&lt;/P&gt;
&lt;P&gt;(I include "9.4' in the search because without it, usually versi0n 9.3 documentation shows up first).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This yields a number of promising links, one of which is a pdf file:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;A href="https://documentation.sas.com/api/collections/pgmsascdc/9.4_3.2/docsets/lefunctionsref/content/lefunctionsref.pdf?locale=en" target="_self"&gt;SAS® 9.4 Functions and CALL Routines: Reference, Fifth Edition&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See page 1610 of the above.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 19:02:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913035#M359888</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-01-25T19:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Week function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913114#M359907</link>
      <description>Thank you for your answear, I would like to have the first week with number 1, not 0.</description>
      <pubDate>Fri, 26 Jan 2024 13:43:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913114#M359907</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2024-01-26T13:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Week function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913115#M359908</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you for your answear, I would like to have the first week with number 1, not 0.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not sure what this means, first week of what year? How do you define first week?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why don't you just add 1 to the week zero answer you are getting?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, if I were you, I would try the three different options of the WEEK function and see if one of them does what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 13:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913115#M359908</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-01-26T13:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Week function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913135#M359922</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you for your answear, I would like to have the first week with number 1, not 0.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Rules for "first week". For example first week of what? Calendar year? Fiscal Year? Month? Calendar quarter?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example data values, I have to assume dates, as a working data step and the expected result. Read the documentation on the week function and the U V and W options. If one of them matches use it. If not, describe what you actually want with values and rules.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 15:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913135#M359922</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-01-26T15:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Week function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913163#M359928</link>
      <description>&lt;P&gt;According to the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n1ka2ulrvrjlasn0z7beco2yrgas.htm" target="_blank" rel="noopener"&gt;WEEK function doc&lt;/A&gt; the 'V' option counts from 1. The U and W options start from 0. As I already mentioned the V option does the ISO definition.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 21:14:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913163#M359928</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-01-26T21:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Week function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913203#M359941</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you for your answear, I would like to have the first week with number 1, not 0.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;First week of what interval? A year? A month?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What day of the week does a week start on?&amp;nbsp; Is it Sunday?&amp;nbsp; Or do weeks always start of the day of the week that Jan01 falls on?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you do with partial week at the start of a year?&amp;nbsp; Say Jan01 is on a Tuesday?&amp;nbsp; does that mean that week 1 only has 5 days (from Tuesday to Saturday) instead of 7 days?&amp;nbsp; Or does week one has 12 days instead of 7?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you do with partial week at the end of the year?&amp;nbsp; Take the year 2012, that started on a Sunday.&amp;nbsp; Does that mean the Dec30 and 31 are part of week 53 for 2012? Or are they part of week 1 for 2013?&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jan 2024 15:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913203#M359941</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-27T15:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Week function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913409#M360035</link>
      <description>Thank you very much !</description>
      <pubDate>Mon, 29 Jan 2024 15:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Week-function/m-p/913409#M360035</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2024-01-29T15:13:14Z</dc:date>
    </item>
  </channel>
</rss>

