<?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: Using today's date to target a .xls file from webpage in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-today-s-date-to-target-a-xls-file-from-webpage/m-p/78885#M17047</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked like a charm. Thanks for the quick reply and fix&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jul 2012 05:10:59 GMT</pubDate>
    <dc:creator>pants4</dc:creator>
    <dc:date>2012-07-31T05:10:59Z</dc:date>
    <item>
      <title>Using today's date to target a .xls file from webpage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-today-s-date-to-target-a-xls-file-from-webpage/m-p/78883#M17045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;I'm trying to import a .xls file that is posted daily as part of an automated procedure.&amp;nbsp; A sample path is shown below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.xyzqrs.com/Reports/20120730_ex.xls"&gt;https://www.xyzqrs.com/Reports/20120730_ex.xls&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;filename website http &lt;SPAN style="color: #ff0000;"&gt;"&lt;A href="https://www.xyzqrs.com/Reports/20120730_ex.xls" title="https://www.xyzqrs.com/Reports/20120730_ex.xls"&gt;&lt;SPAN style="color: #ff0000;"&gt;https://www.xyzqrs.com/Reports/20120730_ex.xls&lt;/SPAN&gt;&lt;/A&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;debug&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data file;&lt;BR /&gt;&amp;nbsp; n=-1;&lt;BR /&gt;&amp;nbsp; infile website nbyte=n length=len;&lt;BR /&gt;&amp;nbsp; input;&lt;BR /&gt;&amp;nbsp; file "20120730_ex.xls";&lt;BR /&gt;&amp;nbsp; put _infile_ $varying32767. len;&lt;BR /&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT=WORK.excelfile DATAFILE="20120730_ex.xls" DBMS=EXCEL REPLACE;&lt;BR /&gt;GETNAMES=NO;&lt;BR /&gt;MIXED=YES;&lt;BR /&gt;SCANTEXT=YES;&lt;BR /&gt;USEDATE=YES;&lt;BR /&gt;SCANTIME=YES;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to somehow use a macro variable or some other method to edit red text above, so everyday when this runs, it grabs the most recent file. I've tried to use macro variables to pass in the date, but it doesn't read it correctly in the program. I've tried researching the answer online, but no luck up to this point. Any help is appreciated...Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 04:19:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-today-s-date-to-target-a-xls-file-from-webpage/m-p/78883#M17045</guid>
      <dc:creator>pants4</dc:creator>
      <dc:date>2012-07-31T04:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using today's date to target a .xls file from webpage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-today-s-date-to-target-a-xls-file-from-webpage/m-p/78884#M17046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't test this at the moment, but think it is either correct or close enough that you should be able to get it to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let fname=%sysfunc(putn(%sysfunc(today()),yymmddN8.));&lt;BR /&gt;filename website http "&lt;A href="https://www.xyzqrs.com/Reports/&amp;amp;fname._ex.xls"&gt;https://www.xyzqrs.com/Reports/&amp;amp;fname._ex.xls&lt;/A&gt;" debug;&lt;/P&gt;&lt;P&gt;data file;&lt;BR /&gt;&amp;nbsp; n=-1;&lt;BR /&gt;&amp;nbsp; infile website nbyte=n length=len;&lt;BR /&gt;&amp;nbsp; input;&lt;BR /&gt;&amp;nbsp; file "&amp;amp;fname._ex.xls";&lt;BR /&gt;&amp;nbsp; put _infile_ $varying32767. len;&lt;BR /&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT=WORK.excelfile DATAFILE="&amp;amp;fname._ex.xls" DBMS=EXCEL REPLACE;&lt;BR /&gt;GETNAMES=NO;&lt;BR /&gt;MIXED=YES;&lt;BR /&gt;SCANTEXT=YES;&lt;BR /&gt;USEDATE=YES;&lt;BR /&gt;SCANTIME=YES;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 04:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-today-s-date-to-target-a-xls-file-from-webpage/m-p/78884#M17046</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-07-31T04:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using today's date to target a .xls file from webpage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-today-s-date-to-target-a-xls-file-from-webpage/m-p/78885#M17047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked like a charm. Thanks for the quick reply and fix&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 05:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-today-s-date-to-target-a-xls-file-from-webpage/m-p/78885#M17047</guid>
      <dc:creator>pants4</dc:creator>
      <dc:date>2012-07-31T05:10:59Z</dc:date>
    </item>
  </channel>
</rss>

