<?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: SAS date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/700933#M214572</link>
    <description>&lt;P&gt;Do you want macro variables? or data set values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you want to have happen if you provide an end value that is not 7 days from the start of a "week"?&lt;/P&gt;</description>
    <pubDate>Mon, 23 Nov 2020 15:33:39 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-11-23T15:33:39Z</dc:date>
    <item>
      <title>SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/700929#M214568</link>
      <description>&lt;P&gt;I would like to create weekly data from a start date to end date with a week indication variable, see example wanted data.&lt;/P&gt;
&lt;P&gt;%let Start= "7feb2020"d;&lt;/P&gt;
&lt;P&gt;%let End=''2apr2020"d;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wanted Data:&lt;/P&gt;
&lt;P&gt;Start_week End _week&amp;nbsp; Week_Indicator&lt;/P&gt;
&lt;P&gt;7feb2020&amp;nbsp; &amp;nbsp; 13feb2020&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;
&lt;P&gt;14feb2020&amp;nbsp; &amp;nbsp;20feb2020&amp;nbsp; &amp;nbsp; 2&lt;/P&gt;
&lt;P&gt;21feb2020&amp;nbsp; &amp;nbsp;27feb2020&amp;nbsp; &amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;28feb2020&amp;nbsp; &amp;nbsp;5mar2020&amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;/P&gt;
&lt;P&gt;6mar2020&amp;nbsp; &amp;nbsp;12mar2020&amp;nbsp; &amp;nbsp; 5&lt;/P&gt;
&lt;P&gt;13mar2020&amp;nbsp; &amp;nbsp;19mar2020&amp;nbsp; &amp;nbsp;6&lt;/P&gt;
&lt;P&gt;20mar2020&amp;nbsp; 26mar2020&amp;nbsp; &amp;nbsp; 7&lt;/P&gt;
&lt;P&gt;27mar2020&amp;nbsp; &amp;nbsp;2apr2020&amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 15:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/700929#M214568</guid>
      <dc:creator>Emma8</dc:creator>
      <dc:date>2020-11-23T15:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/700933#M214572</link>
      <description>&lt;P&gt;Do you want macro variables? or data set values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you want to have happen if you provide an end value that is not 7 days from the start of a "week"?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 15:33:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/700933#M214572</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-23T15:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/700934#M214573</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let Start= "07feb2020"d;

%let End='02apr2020'd;


data want;
 start_week=&amp;amp;start;
 end_week=.;
 do Week_Indicator=1 by 1 while(start_week&amp;lt;&amp;amp;end);
  end_week=start_week+6;
  output;
  start_week=end_week+1;
 end;
 format start_week end_week date9.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Nov 2020 15:33:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/700934#M214573</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-11-23T15:33:39Z</dc:date>
    </item>
    <item>
      <title>Betreff: SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/700935#M214574</link>
      <description>&lt;P&gt;Here you are a quick solution. I hope it fits. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let Start=7feb2020;&lt;BR /&gt;%let End=2apr2020;&lt;/P&gt;&lt;P&gt;data weeks (keep=Start_Week End_Week Week_indicator);&lt;BR /&gt;format Start_Week End_week date9.;&lt;BR /&gt;do i="&amp;amp;Start"d to "&amp;amp;End"d by 7;&lt;BR /&gt;Start_Week = i;&lt;BR /&gt;End_week = i+6;&lt;BR /&gt;Week_indicator + 1;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 15:33:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/700935#M214574</guid>
      <dc:creator>KlausBücher</dc:creator>
      <dc:date>2020-11-23T15:33:42Z</dc:date>
    </item>
  </channel>
</rss>

