<?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: Extra '/' inserted in file path/name arguement, after MACRO call in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extra-inserted-in-file-path-name-arguement-after-MACRO-call/m-p/256172#M49044</link>
    <description>&lt;P&gt;Thank you, Reeza! &amp;nbsp;Here is the code and log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%MACRO ImportDataSheet( df= );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; proc import datafile=&amp;amp;df dbms=xls out=subjects_nmi replace;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; sheet='dt';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; getnames=yes;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;%MEND ImportDataSheet;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let dpf = "/dir/folder/data/datafile.xls";&lt;/P&gt;
&lt;P&gt;%PUT dpf=&amp;amp;dpf.;&lt;/P&gt;
&lt;P&gt;%ImportDataSheet( df = &amp;amp;dpf. );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;********************&lt;/P&gt;
&lt;P&gt;9 %MACRO ImportDataSheet( df= );&lt;BR /&gt;10 proc import datafile=&amp;amp;df dbms=xls out=subjects_nmi replace;&lt;BR /&gt;11 sheet='dt';&lt;BR /&gt;12 getnames=yes;&lt;BR /&gt;13 run;&lt;BR /&gt;14 %MEND ImportDataSheet;&lt;BR /&gt;15 &lt;BR /&gt;16 %let dpf = "&lt;SPAN&gt;/dir/folder/&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;/datafile.xls";&lt;BR /&gt;17 &lt;BR /&gt;18 %PUT dpf=&amp;amp;dpf.;&lt;BR /&gt;dpf="&lt;SPAN&gt;/dir/folder/&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;/datafile.xls"&lt;BR /&gt;19 &lt;BR /&gt;20 %ImportDataSheet( df = &amp;amp;dpf. );&lt;/P&gt;
&lt;P&gt;Requested Sheet Name not found on Excel -&amp;gt; &lt;SPAN&gt;/dir/folder/&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;//datafile.xls&lt;BR /&gt;Requested Input File Is Invalid&lt;BR /&gt;ERROR: Import unsuccessful. See SAS Log for details.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt; real time 0.00 seconds&lt;BR /&gt; cpu time 0.01 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2016 17:29:31 GMT</pubDate>
    <dc:creator>zz</dc:creator>
    <dc:date>2016-03-11T17:29:31Z</dc:date>
    <item>
      <title>Extra '/' inserted in file path/name arguement, after MACRO call</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extra-inserted-in-file-path-name-arguement-after-MACRO-call/m-p/256166#M49041</link>
      <description>&lt;P&gt;When I pass a&amp;nbsp;file value as file path and file in a macro, why I continue to hit errors with an extra slash '/' in front of the file name:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%LET fn="/dir/folder/filename.xls";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%ImportDataSheet(df=&amp;amp;fn.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Macro code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"proc import datafile=&amp;amp;df dbms=xls out=resulename replace;"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;got a "Can not load sas log" error, with the below file path/name showing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;/dir/folder//filename.xls&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The program inserted an extra '/' in front of the file name, preventing successful loading of the file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How do I successfully pass file path/name variables?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Appreciate your help on this very much!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 17:02:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extra-inserted-in-file-path-name-arguement-after-MACRO-call/m-p/256166#M49041</guid>
      <dc:creator>zz</dc:creator>
      <dc:date>2016-03-11T17:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extra '/' inserted in file path/name arguement, after MACRO call</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extra-inserted-in-file-path-name-arguement-after-MACRO-call/m-p/256168#M49042</link>
      <description>&lt;P&gt;Although that may appear to be the error, it's not. There's something else inyour code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post your full code and log, using the code icon above, rather than plain text in the window.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The full code/log should provide enough info to help find the error.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 17:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extra-inserted-in-file-path-name-arguement-after-MACRO-call/m-p/256168#M49042</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-11T17:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extra '/' inserted in file path/name arguement, after MACRO call</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extra-inserted-in-file-path-name-arguement-after-MACRO-call/m-p/256172#M49044</link>
      <description>&lt;P&gt;Thank you, Reeza! &amp;nbsp;Here is the code and log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%MACRO ImportDataSheet( df= );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; proc import datafile=&amp;amp;df dbms=xls out=subjects_nmi replace;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; sheet='dt';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; getnames=yes;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;%MEND ImportDataSheet;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let dpf = "/dir/folder/data/datafile.xls";&lt;/P&gt;
&lt;P&gt;%PUT dpf=&amp;amp;dpf.;&lt;/P&gt;
&lt;P&gt;%ImportDataSheet( df = &amp;amp;dpf. );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;********************&lt;/P&gt;
&lt;P&gt;9 %MACRO ImportDataSheet( df= );&lt;BR /&gt;10 proc import datafile=&amp;amp;df dbms=xls out=subjects_nmi replace;&lt;BR /&gt;11 sheet='dt';&lt;BR /&gt;12 getnames=yes;&lt;BR /&gt;13 run;&lt;BR /&gt;14 %MEND ImportDataSheet;&lt;BR /&gt;15 &lt;BR /&gt;16 %let dpf = "&lt;SPAN&gt;/dir/folder/&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;/datafile.xls";&lt;BR /&gt;17 &lt;BR /&gt;18 %PUT dpf=&amp;amp;dpf.;&lt;BR /&gt;dpf="&lt;SPAN&gt;/dir/folder/&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;/datafile.xls"&lt;BR /&gt;19 &lt;BR /&gt;20 %ImportDataSheet( df = &amp;amp;dpf. );&lt;/P&gt;
&lt;P&gt;Requested Sheet Name not found on Excel -&amp;gt; &lt;SPAN&gt;/dir/folder/&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;//datafile.xls&lt;BR /&gt;Requested Input File Is Invalid&lt;BR /&gt;ERROR: Import unsuccessful. See SAS Log for details.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt; real time 0.00 seconds&lt;BR /&gt; cpu time 0.01 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 17:29:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extra-inserted-in-file-path-name-arguement-after-MACRO-call/m-p/256172#M49044</guid>
      <dc:creator>zz</dc:creator>
      <dc:date>2016-03-11T17:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extra '/' inserted in file path/name arguement, after MACRO call</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extra-inserted-in-file-path-name-arguement-after-MACRO-call/m-p/256173#M49045</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60304"&gt;@zz&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Requested Sheet Name not found on Excel -&amp;gt; /dir/folder/data//datafile.xls&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;Requested Input File Is Invalid&lt;BR /&gt;ERROR: Import unsuccessful. See SAS Log for details.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt; real time 0.00 seconds&lt;BR /&gt; cpu time 0.01 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check your excel file and ensure it has a sheet labeled DT without any extra spaces.&lt;/P&gt;
&lt;P&gt;I would also suggest just running that code, without the macro portion until you get it working and then switch to the macro code.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 17:31:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extra-inserted-in-file-path-name-arguement-after-MACRO-call/m-p/256173#M49045</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-11T17:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extra '/' inserted in file path/name arguement, after MACRO call</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extra-inserted-in-file-path-name-arguement-after-MACRO-call/m-p/256178#M49046</link>
      <description>&lt;P&gt;Also the path you are passing is relative and will expecte the file mentioned to be in a folder subordinate to the current active path SAS is using. Which may very well not be where you expect. I would recommend always using a complete path to insure the location.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, are you running in a server environment? The input file would have to be on the server to be found.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 17:49:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extra-inserted-in-file-path-name-arguement-after-MACRO-call/m-p/256178#M49046</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-03-11T17:49:33Z</dc:date>
    </item>
  </channel>
</rss>

