title: Using SAS Macro to pipe a list of filenames from a Windows directory
body: <p>I am trying to amend the macro below to accept a macro parameter as the 'location' argument for a dir command.  However I cannot get it to resolve correctly due to the nested quotes issue.  Using %str(%') does not work, neither do quoting functions for some reason.</p>
  
  <p>The macro will work fine when the filepath has <strong>no spaces</strong> (eg C:\temp\withnospace) as the middle quotes aren't needed.  However I need this macro to work for filepaths <strong>with spaces</strong> (eg 'C:\temp\with space\').</p>
  
  <p>Please help!  </p>
  
  <pre><code>%macro get_filenames(location)
     filename pipedir pipe   "dir &amp;location. /b " lrecl=32767;
     data filenames;
       infile pipedir truncover;
       input line $char1000.;
     run;
  %mend;
  
  %get_filenames(C:\temp\)              /* works */
  %get_filenames('C:\temp\with space')  /* doesnt work */
  </code></pre>