title: Determine the folder of a SAS source file
body: <p>When I open a SAS file in enterprise guide and run it, it is executed on the server. The source file itself is located either on the production site or the development site. In both cases, it is executed the same server however. I want to be able to tell my script to store results in a relative folder. But if I write something like </p>
  
  <pre><code>libname lib_out xport "..\tmp\foobar.xpt";
  </code></pre>
  
  <p>I get an error, because the working folder of the SAS Enterprise Guide process is not the location of my source file, but a folder on the server. And the folder <code>..\tmp</code> does not exist there. Even if it would, the server process does not have write permission in that folder.</p>
  
  <p>I would like to determine from which folder the <code>.sas</code> file was loaded and set the working folder accordingly. In one case it's <code>S:\Development\myproject\sas\foobar.sas</code> and in the other case it's <code>S:\Production\myproject\sas\foobar.sas</code></p>
  
  <p>It this possible at all? Or how would you do this?</p>