<?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 find the week of the date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-week-of-the-date/m-p/601874#M174164</link>
    <description>&lt;P&gt;There are different definitions for deriving the week of the year. These are explained in the documentation: &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n1ka2ulrvrjlasn0z7beco2yrgas.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n1ka2ulrvrjlasn0z7beco2yrgas.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2019 06:25:49 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2019-11-06T06:25:49Z</dc:date>
    <item>
      <title>How to find the week of the date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-week-of-the-date/m-p/601870#M174160</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was just wondering how I am able to find the week of the variable date.&lt;/P&gt;&lt;P&gt;the variable shows the dates in YYMMDD format (2015-08-20), however the proc contents shows the variable ac character $14.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the week of&amp;nbsp;2015-08-20 is 34. The dataset is too big and I am not able to work with Excel. I should use SAS function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You help will be appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 06:04:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-week-of-the-date/m-p/601870#M174160</guid>
      <dc:creator>fama</dc:creator>
      <dc:date>2019-11-06T06:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the week of the date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-week-of-the-date/m-p/601871#M174161</link>
      <description>&lt;P&gt;Convert to a real SAS date value, and use the week() function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
chardate = '2015-08-20';
numdate = input(chardate,yymmdd10.);
format numdate yymmddd10.;
weeknum = week(numdate);
put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt;24         data _null_;
25         chardate = '2015-08-20';
26         numdate = input(chardate,yymmdd10.);
27         format numdate yymmddd10.;
28         weeknum = week(numdate);
29         put _all_;
30         run;

chardate=2015-08-20 numdate=2015-08-20 weeknum=33 _ERROR_=0 _N_=1
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Nov 2019 06:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-week-of-the-date/m-p/601871#M174161</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-06T06:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the week of the date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-week-of-the-date/m-p/601873#M174163</link>
      <description>&lt;P&gt;If your variable containing the date is of character type, you must convert it to a numeric format first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Input converts your character variable read in the format yymmdd10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
date_char_fmt='2015-08-20';
week_of_date=week(input(date_char_fmt,yymmdd10.));
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Nov 2019 06:23:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-week-of-the-date/m-p/601873#M174163</guid>
      <dc:creator>sustagens</dc:creator>
      <dc:date>2019-11-06T06:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the week of the date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-week-of-the-date/m-p/601874#M174164</link>
      <description>&lt;P&gt;There are different definitions for deriving the week of the year. These are explained in the documentation: &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n1ka2ulrvrjlasn0z7beco2yrgas.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n1ka2ulrvrjlasn0z7beco2yrgas.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 06:25:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-week-of-the-date/m-p/601874#M174164</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-11-06T06:25:49Z</dc:date>
    </item>
  </channel>
</rss>

