Determine the folder of a SAS source file

Posted by exhuma on Stack Overflow See other posts from Stack Overflow or by exhuma
Published on 2010-06-02T13:12:29Z Indexed on 2010/06/02 14:03 UTC
Read the original article Hit count: 277

Filed under:
|

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

libname lib_out xport "..\tmp\foobar.xpt";

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 ..\tmp does not exist there. Even if it would, the server process does not have write permission in that folder.

I would like to determine from which folder the .sas file was loaded and set the working folder accordingly. In one case it's S:\Development\myproject\sas\foobar.sas and in the other case it's S:\Production\myproject\sas\foobar.sas

It this possible at all? Or how would you do this?

© Stack Overflow or respective owner

Related posts about sas

Related posts about enterprise-guide