<?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 Converting week and year variables to MM/DD/YYYY in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-week-and-year-variables-to-MM-DD-YYYY/m-p/80608#M7877</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have variables in my data set for both the week number and year number.&amp;nbsp; I am looking for a way to convert them to a date column (MM/DD/YYYY or similar format).&amp;nbsp; I know how to convert from a date to week/year, but not vice versa.&amp;nbsp; Does anyone have any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jul 2013 14:06:50 GMT</pubDate>
    <dc:creator>claireluen</dc:creator>
    <dc:date>2013-07-16T14:06:50Z</dc:date>
    <item>
      <title>Converting week and year variables to MM/DD/YYYY</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-week-and-year-variables-to-MM-DD-YYYY/m-p/80608#M7877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have variables in my data set for both the week number and year number.&amp;nbsp; I am looking for a way to convert them to a date column (MM/DD/YYYY or similar format).&amp;nbsp; I know how to convert from a date to week/year, but not vice versa.&amp;nbsp; Does anyone have any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 14:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-week-and-year-variables-to-MM-DD-YYYY/m-p/80608#M7877</guid>
      <dc:creator>claireluen</dc:creator>
      <dc:date>2013-07-16T14:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Converting week and year variables to MM/DD/YYYY</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-week-and-year-variables-to-MM-DD-YYYY/m-p/80609#M7878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WeekW. informat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's one way, but probably not the neatest:&lt;/P&gt;&lt;P&gt;(EDIT: I've assumed the day to be 1, the first of the week, but you could change that by changing the 01 and the end of week_year)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input year week ;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;2001&amp;nbsp;&amp;nbsp;&amp;nbsp; 23&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2001&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2003&amp;nbsp;&amp;nbsp;&amp;nbsp; 45&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2014&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2005&amp;nbsp;&amp;nbsp;&amp;nbsp; 36&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2006&amp;nbsp;&amp;nbsp;&amp;nbsp; 45&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2007&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; week_year=compress(year||"W"||put(week, z2.)||"01");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date_want=input(week_year, weekw9.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format date_want date9.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 14:41:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-week-and-year-variables-to-MM-DD-YYYY/m-p/80609#M7878</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-16T14:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Converting week and year variables to MM/DD/YYYY</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-week-and-year-variables-to-MM-DD-YYYY/m-p/80610#M7879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might be able to use date math to get to the first day of the week&lt;/P&gt;&lt;P&gt;FirstOfWeek = mdy(1,1,yearnum) + (7 * ( weeknum - 1));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;intnx('week',mdy(1,1,yearnum),weeknum-1);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 14:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-week-and-year-variables-to-MM-DD-YYYY/m-p/80610#M7879</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-07-16T14:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Converting week and year variables to MM/DD/YYYY</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-week-and-year-variables-to-MM-DD-YYYY/m-p/80611#M7880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was really helpful.&amp;nbsp; Thanks to both of you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 14:58:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-week-and-year-variables-to-MM-DD-YYYY/m-p/80611#M7880</guid>
      <dc:creator>claireluen</dc:creator>
      <dc:date>2013-07-16T14:58:30Z</dc:date>
    </item>
  </channel>
</rss>

