<?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: Importing previous day Excel file with date Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-previous-day-Excel-file-with-date-Macro/m-p/286748#M58886</link>
    <description>&lt;P&gt;Thanks DJongman.&lt;/P&gt;&lt;P&gt;I used your method and tweaked it a bit and it was the exact output i wanted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2016 03:04:04 GMT</pubDate>
    <dc:creator>Yvegunta</dc:creator>
    <dc:date>2016-07-25T03:04:04Z</dc:date>
    <item>
      <title>Importing previous day Excel file with date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-previous-day-Excel-file-with-date-Macro/m-p/285436#M58355</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to import an Excel file (.xlsx), which currently sits on the server.&lt;/P&gt;&lt;P&gt;The query i have been trying to run is as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;import&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datafile&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=New_File_&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;Pdate.&lt;STRONG&gt;.x&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;lsx (&amp;amp;Pdate:is a macro assigned for previous day)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;out&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=Prev_File&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dbms&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=XLSX;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Getnames&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=Yes;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;However, i have been getting this error:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;16 Proc import datafile=New_File_&amp;amp;Pdate..xlsx&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the macro variable "PDATE".&lt;/P&gt;&lt;P&gt;16 New_File_18JUL2016&lt;/P&gt;&lt;P&gt;_________________&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;201&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.00 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string.&lt;/P&gt;&lt;P&gt;ERROR 201-322: The option is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me understand, what the error is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 04:37:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-previous-day-Excel-file-with-date-Macro/m-p/285436#M58355</guid>
      <dc:creator>Yvegunta</dc:creator>
      <dc:date>2016-07-19T04:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Importing previous day Excel file with date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-previous-day-Excel-file-with-date-Macro/m-p/285447#M58361</link>
      <description>&lt;P&gt;You need put double QUOTE around it .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;import&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;datafile&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;STRONG&gt;"c:\temp\New_File_&amp;amp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;Pdate..x&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;lsx" replace&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;out&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=Prev_File&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;dbms&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=XLSX;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;Getnames&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=Yes;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 07:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-previous-day-Excel-file-with-date-Macro/m-p/285447#M58361</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-19T07:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Importing previous day Excel file with date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-previous-day-Excel-file-with-date-Macro/m-p/285448#M58362</link>
      <description>&lt;P&gt;I can't explain exactly your error, but tested the next code below and that is working:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let pdate =  %sysfunc(putn(%eval(%sysfunc(today())-1),date9.));

Proc import out = work.xlsdat
	datafile = "c:\New_File_&amp;amp;pdate.xlsx"
	dbms = xlsx replace;
	getnames = yes;
run;&lt;/PRE&gt;
&lt;P&gt;Maybe you can use this for you own macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 07:09:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-previous-day-Excel-file-with-date-Macro/m-p/285448#M58362</guid>
      <dc:creator>DJongman</dc:creator>
      <dc:date>2016-07-19T07:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Importing previous day Excel file with date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-previous-day-Excel-file-with-date-Macro/m-p/286748#M58886</link>
      <description>&lt;P&gt;Thanks DJongman.&lt;/P&gt;&lt;P&gt;I used your method and tweaked it a bit and it was the exact output i wanted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 03:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-previous-day-Excel-file-with-date-Macro/m-p/286748#M58886</guid>
      <dc:creator>Yvegunta</dc:creator>
      <dc:date>2016-07-25T03:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Importing previous day Excel file with date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-previous-day-Excel-file-with-date-Macro/m-p/286749#M58887</link>
      <description>&lt;P&gt;Thank you KSharp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 03:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-previous-day-Excel-file-with-date-Macro/m-p/286749#M58887</guid>
      <dc:creator>Yvegunta</dc:creator>
      <dc:date>2016-07-25T03:04:35Z</dc:date>
    </item>
  </channel>
</rss>

