<?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 transfer date to week of year in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320931#M21495</link>
    <description>&lt;P&gt;Hi thank you for your reply.&lt;/P&gt;&lt;P&gt;I'm sure this is a date column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm not sure whether you could see my attachment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i know i might be able to achieve this by change the code, but i'm wondering if there is any way throught query builder.&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13280i9182611BD40505B5/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.JPG" title="Capture.JPG" /&gt;</description>
    <pubDate>Fri, 23 Dec 2016 14:24:39 GMT</pubDate>
    <dc:creator>mengjiawei</dc:creator>
    <dc:date>2016-12-23T14:24:39Z</dc:date>
    <item>
      <title>how to transfer date to week of year</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320831#M21491</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I'm faced a problem when trying to transfer specific date data into "week of year". SAS guidance tells me to use "right click the column--properties--formats--WEEK...". I did accordingly, but the result just shows "****", as the right column in the picture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anyone help with this? what is the right way to sovle it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;&lt;P&gt;Kira&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 22:24:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320831#M21491</guid>
      <dc:creator>mengjiawei</dc:creator>
      <dc:date>2016-12-22T22:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to transfer date to week of year</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320833#M21492</link>
      <description>&lt;P&gt;That would only change the format for the current display, it wouldn't be saved in any manner.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest creating a new variable and use the WEEK() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use a computed column and advanced expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WEEK(DateVariable, U/W/V).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check which of the U/W/V options you want when calculating WEEK from a date as there are several different methodologies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#n1ka2ulrvrjlasn0z7beco2yrgas.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#n1ka2ulrvrjlasn0z7beco2yrgas.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 22:31:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320833#M21492</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-22T22:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to transfer date to week of year</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320842#M21493</link>
      <description>&lt;P&gt;When manipulating dates first make sure that your original values are SAS date values. A number like 11052016 is not necessarily a date value. If the current display format says the value is $ (character), BEST or F then the value is not likely to actually&amp;nbsp;be the "date"&amp;nbsp; you may think.&lt;/P&gt;
&lt;P&gt;If you have a numeric value such as that 11052016 and try to request a data manipulation such as a function call or format you will get an error as the largest data SAS currently handles, 31DEC19999 is 6588970 &amp;lt; 11052016.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ******* usually means that you have requested SAS to display something that doesn't fit. So I suspect you don't actually have a date or you attempted to display more digits than would fit in the window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the value is currently not a date you may need to either re-import you data in a way the you can indicate that it should be a date or calculate a new variable but we would need to see actual values of the variable to suggest appropriate code.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 22:58:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320842#M21493</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-12-22T22:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to transfer date to week of year</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320931#M21495</link>
      <description>&lt;P&gt;Hi thank you for your reply.&lt;/P&gt;&lt;P&gt;I'm sure this is a date column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm not sure whether you could see my attachment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i know i might be able to achieve this by change the code, but i'm wondering if there is any way throught query builder.&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13280i9182611BD40505B5/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.JPG" title="Capture.JPG" /&gt;</description>
      <pubDate>Fri, 23 Dec 2016 14:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320931#M21495</guid>
      <dc:creator>mengjiawei</dc:creator>
      <dc:date>2016-12-23T14:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to transfer date to week of year</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320939#M21496</link>
      <description>&lt;P&gt;Yes, it was provided above.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use a computed column and advanced expression.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;WEEK(DateVariable, U/W/V).&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 14:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320939#M21496</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-23T14:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to transfer date to week of year</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320950#M21497</link>
      <description>&lt;P&gt;I tried this way, the computed column returns ".", as showed in my attachment.&lt;/P&gt;&lt;P&gt;do you know why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Kira&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13281i85DF76DE42288124/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.JPG" title="Capture.JPG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13282iE5582C2A026E3B02/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture1.JPG" title="Capture1.JPG" /&gt;</description>
      <pubDate>Fri, 23 Dec 2016 15:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320950#M21497</guid>
      <dc:creator>mengjiawei</dc:creator>
      <dc:date>2016-12-23T15:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to transfer date to week of year</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320955#M21498</link>
      <description>&lt;P&gt;You may have fallen victim to a common lazy practice of calling datetime values (those that incorporate a date and time) "dates". SAS dates are counts of days, datetimes are seconds. Your example is DATETIME.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you need to calculate Week(datepart(t1.Requested_date))&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 15:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320955#M21498</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-12-23T15:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to transfer date to week of year</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320962#M21499</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;You may have fallen victim to a common lazy practice of calling datetime values (those that incorporate a date and time) "dates". SAS dates are counts of days, datetimes are seconds. Your example is DATETIME.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you need to calculate Week(datepart(t1.Requested_date))&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;Is correct, your variable is datetime not date. You can see this in your first snapshot as it has a calendar and clock symbol on the variable requested date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 16:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-transfer-date-to-week-of-year/m-p/320962#M21499</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-23T16:17:25Z</dc:date>
    </item>
  </channel>
</rss>

