<?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 Do loop for date variable to import excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Do-loop-for-date-variable-to-import-excel/m-p/790801#M253209</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to import excel file from each week (every friday) and append with the previous week. I need a macro for import and append (append is to convert weekly data into monthly data).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if November 2021 contain 4 weeks of friday, i want to import 4 excel files and append to get the November monthly data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jan 2022 04:03:10 GMT</pubDate>
    <dc:creator>Pooja98</dc:creator>
    <dc:date>2022-01-19T04:03:10Z</dc:date>
    <item>
      <title>Do loop for date variable to import excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-loop-for-date-variable-to-import-excel/m-p/790801#M253209</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to import excel file from each week (every friday) and append with the previous week. I need a macro for import and append (append is to convert weekly data into monthly data).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if November 2021 contain 4 weeks of friday, i want to import 4 excel files and append to get the November monthly data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 04:03:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-loop-for-date-variable-to-import-excel/m-p/790801#M253209</guid>
      <dc:creator>Pooja98</dc:creator>
      <dc:date>2022-01-19T04:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Do loop for date variable to import excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-loop-for-date-variable-to-import-excel/m-p/790802#M253210</link>
      <description>&lt;P&gt;Where are the EXCEL files?&lt;/P&gt;
&lt;P&gt;What are the NAME(s) of the EXCEL files?&lt;/P&gt;
&lt;P&gt;What type of EXCEL files are they?&lt;/P&gt;
&lt;P&gt;How to you tell which MONTH you want to read the files for?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to find all of the FRIDAYs in a month use something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data friday;
  target=today();
  do n=1 to 5 while(date &amp;lt; NWKDOM(5, 5, month(target),year(target)));
    date=NWKDOM(n, 5, month(target),year(target));
    output;
  end;
  format target date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;PRE&gt;Obs       target    n         date

 1     18JAN2022    1    06JAN2022
 2     18JAN2022    2    13JAN2022
 3     18JAN2022    3    20JAN2022
 4     18JAN2022    4    27JAN2022

&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jan 2022 04:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-loop-for-date-variable-to-import-excel/m-p/790802#M253210</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-01-19T04:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Do loop for date variable to import excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-loop-for-date-variable-to-import-excel/m-p/790806#M253211</link>
      <description>&lt;P&gt;Excel files names are:&lt;/P&gt;&lt;P&gt;1. 20220107&lt;/P&gt;&lt;P&gt;2. 20220114&lt;/P&gt;&lt;P&gt;3. 20220121&lt;/P&gt;&lt;P&gt;4. 20220128&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the end of the month, i want to import the data for the mentioned above 4 weeks and want to append to get the entire week data, "Looking for a import code"&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 04:56:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-loop-for-date-variable-to-import-excel/m-p/790806#M253211</guid>
      <dc:creator>Pooja98</dc:creator>
      <dc:date>2022-01-19T04:56:02Z</dc:date>
    </item>
  </channel>
</rss>

