title: "XLSX file does not exist" error when using SAS Macro & Proc Import to import multiple .xlsx files at same time
body: <p>I have a sas macro that use proc import to load multiple .xlsx files and it worked pretty well before. Today, I have a bunch more .xlsx files files that need to be loaded. So, I used the same macro idea. But this time it created a problem and couldn't run through. Here is the sas code:</p>
  
  <pre><code>*name q3 file path;
  filename file01 '/home/myname/gcs_coded/Los Angeles_CA_Q3_English_EF.xlsx';
  filename file02 '/home/myname/gcs_coded/Los Angeles_CA_Q3_English_Prime.xlsx';
  filename file03 '/home/myname/gcs_coded/Los Angeles_CA_Q3_Spanish_ET.xlsx';
  filename file04 '/home/myname/gcs_coded/Los Angeles_CA_Q3_Spanish_Prime.xlsx';
  
  %macro load (id=, filename= );
  
  proc import out = &amp;id
          datafile = &amp;filename
          dbms = xlsx
          replace;
          sheet = "sheet1";
  getnames = yes;
  run;
  
  %mend load;
  
  %load (id=q3_01, filename=file01); 
  </code></pre>
  
  <p>and here is the erro message:</p>
  
  <pre><code>ERROR: XLSX file does not exist -&gt; /FILE01.xlsx
  
  NOTE: The SAS System stopped processing this step because of errors.
  NOTE: PROCEDURE IMPORT used (Total process time):
    real time           0.00 seconds
    cpu time            0.01 seconds
  </code></pre>
  
  <p>But very interestingly, I then took out the second marco parameter but just copy in the file link, like the following, it runs well, which means the link is alright and the file exits.</p>
  
  <pre><code>%macro load (id= );
  
  proc import out = &amp;id
          datafile = '/home/myname/gcs_coded/Los Angeles_CA_Q3_English_EF.xlsx'
          dbms = xlsx
          replace;
          sheet = "sheet1";
          getnames = yes;
  run;
  
  %mend load;
  
  %load (id=q3_01)
  </code></pre>
  
  <p>Let me know what you guys think. Thanks</p>