<?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 determine the week of the year and change the start of the week from Sunday to Friday in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493583#M129859</link>
    <description>&lt;P&gt;INTCK&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;start date is '01JAN18'd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;end date is the date variable value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gives you the number of weeks since January 1, 2018, and when you do it properly, it counts weeks starting on Friday&lt;/P&gt;</description>
    <pubDate>Fri, 07 Sep 2018 18:58:41 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-09-07T18:58:41Z</dc:date>
    <item>
      <title>How to determine the week of the year and change the start of the week from Sunday to Friday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493429#M129802</link>
      <description>&lt;P&gt;&amp;nbsp;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have SAS date&amp;nbsp;for various events and for each observation I want to determine which week of the year the event happen. However, i want that the week would start on Friday, not Sunday. How can i do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 13:53:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493429#M129802</guid>
      <dc:creator>viollete</dc:creator>
      <dc:date>2018-09-07T13:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine the week of the year and change the start of the week from Sunday to Friday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493439#M129807</link>
      <description>&lt;P&gt;You need to use the INTCK function. You can specify what day of the week the function should start from, in your case Friday.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See:&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0syn64amroombn14vrdzksh459w.htm&amp;amp;locale=en#n1wbckrlffgb8jn15eebgjpqm23c" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0syn64amroombn14vrdzksh459w.htm&amp;amp;locale=en#n1wbckrlffgb8jn15eebgjpqm23c&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 14:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493439#M129807</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-09-07T14:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine the week of the year and change the start of the week from Sunday to Friday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493446#M129811</link>
      <description>&lt;P&gt;If January 1 is a Thursday, do you want the first week of the year to contain just a single day?&amp;nbsp; Then January 2 through January 8 would be week 2?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 14:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493446#M129811</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-09-07T14:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine the week of the year and change the start of the week from Sunday to Friday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493490#M129825</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37682"&gt;@viollete&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have SAS date&amp;nbsp;for various events and for each observation I want to determine which week of the year the event happen. However, i want that the week would start on Friday, not Sunday. How can i do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You should provide some example of how this start of week on Friday is going to be used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example read the documentation on the WEEK function and the uses of the U, V and W descriptors on determining week number of year values returned to see some things that may need to be considered for your specific usage. For instance what if Friday is in a different calendar year? Is it still the start of your week?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 15:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493490#M129825</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-07T15:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine the week of the year and change the start of the week from Sunday to Friday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493520#M129829</link>
      <description>&lt;P&gt;yes, for example in 2018 1 week would be from 1 January till 4 January, second from 5 to 8 and so on...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I looked at INTCK function, however i need to give start and end dates, but I have a variable and i do not&amp;nbsp; want to look what time period it consists every time i use it.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 15:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493520#M129829</guid>
      <dc:creator>viollete</dc:creator>
      <dc:date>2018-09-07T15:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine the week of the year and change the start of the week from Sunday to Friday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493537#M129837</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37682"&gt;@viollete&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input d yymmdd8.;
format d weekdatx.;
cards;
20151231
20160101
20171228
20171229
20171231
20180101
20180104
20180105
20180907
;

data want;
set have;
wk=intck('week.6', intnx('year',d,0), d)+1;
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Sep 2018 16:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493537#M129837</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-09-07T16:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine the week of the year and change the start of the week from Sunday to Friday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493557#M129846</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37682"&gt;@viollete&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;yes, for example in 2018 1 week would be from 1 January till 4 January, second from 5 to 8 and so on...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I looked at INTCK function, however i need to give start and end dates, but I have a variable and i do not&amp;nbsp; want to look what time period it consists every time i use it.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One hopes that you meant the second week is 5 to 11 or we have another issue involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again I ask, HOW are your intending to use this? On what duration of data? Please provide an explicit example of some date values and how you are using "Friday starting week". It likely isn't very difficult but without knowing if what you want is shift for the WEEK function, using a variation of one of the WEEKU, WEEKV or WEEKW formats, or something else it is very difficult to provide an actual solution to a-not-well-defined problem.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 17:13:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493557#M129846</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-07T17:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine the week of the year and change the start of the week from Sunday to Friday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493583#M129859</link>
      <description>&lt;P&gt;INTCK&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;start date is '01JAN18'd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;end date is the date variable value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gives you the number of weeks since January 1, 2018, and when you do it properly, it counts weeks starting on Friday&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 18:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/493583#M129859</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-09-07T18:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine the week of the year and change the start of the week from Sunday to Friday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/494025#M130108</link>
      <description>&lt;P&gt;I have at least 10 years period and over several millions observation. For each year, I want to find in which week the observation happened. So each year will have 1-52/53 weeks.&lt;/P&gt;
&lt;P&gt;if&amp;nbsp;sas date is between 1st January 2018 and 4th January, week=1, if between 5th January 2018 and 11th then week=2&lt;/P&gt;
&lt;P&gt;if&amp;nbsp;sa date is between 1st January 2017 and 5th January, week=1, if between 6th January 2017 and 12th then week=2&lt;/P&gt;
&lt;P&gt;and so on...&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 07:29:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/494025#M130108</guid>
      <dc:creator>viollete</dc:creator>
      <dc:date>2018-09-10T07:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine the week of the year and change the start of the week from Sunday to Friday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/494036#M130109</link>
      <description>&lt;P&gt;Again:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set your_dataset;
week=intck('week.6', intnx('year', your_sasdatevar, 0), your_sasdatevar)+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Sep 2018 08:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-determine-the-week-of-the-year-and-change-the-start-of/m-p/494036#M130109</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-09-10T08:00:34Z</dc:date>
    </item>
  </channel>
</rss>

