<?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 new date variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/new-date-variables/m-p/127404#M26019</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear SAS Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a list of "Old_dates" of which I would like to create a new variable "New_dates" that groups the "Old_dates by week according to the last Saturday in that week.&amp;nbsp; See my example below.&amp;nbsp; As I have many years worth of dates, how do I automate the process?&amp;nbsp; I'd like to avoid manual coding for the new variable (i.e. if '02Mar2013' &amp;lt; old_date &amp;lt;=09Mar2013 then new_dates = '09Mar2013').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, old_dates may not always have all 7 days in a week listed.&amp;nbsp; Sometimes only 3-4 dates are listed per each 7 day time frame and one may or may not be a Saturday (see "New-dates=09Mar2013).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;Sophia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Old_dates&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New_dates&lt;/P&gt;&lt;P&gt;24Feb2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;25Feb2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;26Feb2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;27Feb2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;28Feb2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;01Mar2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;02Mar2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;05Mar2013 = 09Mar2013&lt;/P&gt;&lt;P&gt;06Mar2013 = 09Mar2013&lt;/P&gt;&lt;P&gt;07Mar2013 = 09Mar2013&lt;/P&gt;&lt;P&gt;08Mar2013 = 09Mar2013&lt;/P&gt;&lt;P&gt;11Mar2013 = 16Mar2013&lt;/P&gt;&lt;P&gt;12Mar2013 = 16Mar2013&lt;/P&gt;&lt;P&gt;13Mar2013 = 16Mar2013&lt;/P&gt;&lt;P&gt;16Mar2013 = 16Mar2013&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Mar 2013 12:32:24 GMT</pubDate>
    <dc:creator>sophia_SAS</dc:creator>
    <dc:date>2013-03-05T12:32:24Z</dc:date>
    <item>
      <title>new date variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/new-date-variables/m-p/127404#M26019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear SAS Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a list of "Old_dates" of which I would like to create a new variable "New_dates" that groups the "Old_dates by week according to the last Saturday in that week.&amp;nbsp; See my example below.&amp;nbsp; As I have many years worth of dates, how do I automate the process?&amp;nbsp; I'd like to avoid manual coding for the new variable (i.e. if '02Mar2013' &amp;lt; old_date &amp;lt;=09Mar2013 then new_dates = '09Mar2013').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, old_dates may not always have all 7 days in a week listed.&amp;nbsp; Sometimes only 3-4 dates are listed per each 7 day time frame and one may or may not be a Saturday (see "New-dates=09Mar2013).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;Sophia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Old_dates&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New_dates&lt;/P&gt;&lt;P&gt;24Feb2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;25Feb2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;26Feb2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;27Feb2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;28Feb2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;01Mar2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;02Mar2013 = 02Mar2013&lt;/P&gt;&lt;P&gt;05Mar2013 = 09Mar2013&lt;/P&gt;&lt;P&gt;06Mar2013 = 09Mar2013&lt;/P&gt;&lt;P&gt;07Mar2013 = 09Mar2013&lt;/P&gt;&lt;P&gt;08Mar2013 = 09Mar2013&lt;/P&gt;&lt;P&gt;11Mar2013 = 16Mar2013&lt;/P&gt;&lt;P&gt;12Mar2013 = 16Mar2013&lt;/P&gt;&lt;P&gt;13Mar2013 = 16Mar2013&lt;/P&gt;&lt;P&gt;16Mar2013 = 16Mar2013&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 12:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/new-date-variables/m-p/127404#M26019</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2013-03-05T12:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: new date variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/new-date-variables/m-p/127405#M26020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;new_dates=intnx('week',old_dates,0,'end');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 12:41:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/new-date-variables/m-p/127405#M26020</guid>
      <dc:creator>Keith</dc:creator>
      <dc:date>2013-03-05T12:41:13Z</dc:date>
    </item>
  </channel>
</rss>

