<?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 obtain month through week and year in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197272#M49285</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give a few examples of values you have?&amp;nbsp; Are they like 201501 for first week of 2015?&amp;nbsp; 201552 for fifty-second week of 2015?&amp;nbsp; Or some other format?&amp;nbsp; Also, might need to define what day is the start of the week, etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Aug 2015 01:32:52 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2015-08-12T01:32:52Z</dc:date>
    <item>
      <title>How to obtain month through week and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197271#M49284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might be a simple question: I have week and year information, how can I get the corresponding month?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lizi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 01:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197271#M49284</guid>
      <dc:creator>lizzy28</dc:creator>
      <dc:date>2015-08-12T01:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to obtain month through week and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197272#M49285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give a few examples of values you have?&amp;nbsp; Are they like 201501 for first week of 2015?&amp;nbsp; 201552 for fifty-second week of 2015?&amp;nbsp; Or some other format?&amp;nbsp; Also, might need to define what day is the start of the week, etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 01:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197272#M49285</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-08-12T01:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to obtain month through week and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197273#M49286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Quentin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was basically two columns:&lt;/P&gt;&lt;P&gt;year week&lt;/P&gt;&lt;P&gt;2013&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2013&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;2013&amp;nbsp; 52&lt;/P&gt;&lt;P&gt;2014&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2014&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;2014&amp;nbsp; 52.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 12:59:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197273#M49286</guid>
      <dc:creator>lizzy28</dc:creator>
      <dc:date>2015-08-12T12:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to obtain month through week and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197274#M49287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liziwu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must specify what do you need, a desired output maybe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you need, the month at the begining of the week, at the end, the week is in the month if there are 4 or more days on it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197274#M49287</guid>
      <dc:creator>arodriguez</dc:creator>
      <dc:date>2015-08-12T13:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to obtain month through week and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197275#M49288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data Want;&lt;/P&gt;&lt;P&gt;input Year week;&lt;/P&gt;&lt;P&gt;Mnt_Name=put(input(cat(0101,Year),ddmmyy10.)+(Week-1)*7,monname3.);&lt;/P&gt;&lt;P&gt;Mnt_Num=Month(input(cat(0101,Year),ddmmyy10.)+(Week-1)*7);&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;2013 1&lt;/P&gt;&lt;P&gt;2013 2&lt;/P&gt;&lt;P&gt;2013 16&lt;/P&gt;&lt;P&gt;2013 52&lt;/P&gt;&lt;P&gt;2014 1&lt;/P&gt;&lt;P&gt;2014 2&lt;/P&gt;&lt;P&gt;2014 52&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:19:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197275#M49288</guid>
      <dc:creator>MadhuKorni</dc:creator>
      <dc:date>2015-08-12T13:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to obtain month through week and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197276#M49289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want a date, it being the first date in the given week then you can do something like:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; year='2013'; week=1; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; year='2013'; week=2; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; year='2013'; week=3; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if week=1 then new_date=input("01JAN"||strip(year),date9.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; else new_date=input("01JAN"||strip(year),date9.) + ((week-1) * 7);&lt;/P&gt;&lt;P&gt;&amp;nbsp; format new_date date9.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rembering that a date variable is the number of days since 01Jan1960, so work out the year as 01JAN, gives you the number for that day, then add the week number less 1 (as we want start) multiplied by 7.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:24:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197276#M49289</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-08-12T13:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to obtain month through week and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197277#M49290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What would 2015 week 1 mean?&amp;nbsp; Jan 1, 2015 was a Thursday.&amp;nbsp; So what is the corresponding month for week 1, January? &lt;/P&gt;&lt;P&gt;What would be the first week number of 2015 that would map to February?&amp;nbsp; What's the rule that says which month a year-week number should map to?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:33:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197277#M49290</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-08-12T13:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to obtain month through week and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197278#M49291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data Want;&lt;/P&gt;&lt;P&gt;input Year week;&lt;/P&gt;&lt;P&gt;month=month(intnx('week',mdy(1,1,year),week));;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;2013 1&lt;/P&gt;&lt;P&gt;2013 2&lt;/P&gt;&lt;P&gt;2013 16&lt;/P&gt;&lt;P&gt;2013 52&lt;/P&gt;&lt;P&gt;2014 1&lt;/P&gt;&lt;P&gt;2014 2&lt;/P&gt;&lt;P&gt;2014 52&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197278#M49291</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-08-12T13:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to obtain month through week and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197279#M49292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check informat&amp;nbsp; WEEKU. WEEKV. WEEKW.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-obtain-month-through-week-and-year/m-p/197279#M49292</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-08-12T13:46:21Z</dc:date>
    </item>
  </channel>
</rss>

