- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Is there anyway to determine the path of SAS executable (SAS.exe) dynamically?
Thanks
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you are running on Windows then you can use %SYSGET() to find the value of SASROOT.
So sas.exe should be at
%let location=%sysget(sasroot)\sas.exe ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Look at the setting of the option PATH.
%put %sysfunc(getoption(path));
It might look like this: !SASROOT/sasexe
One way to translate !SASROOT into a path is to use it in a FILENAME or LIBNAME statement.
filename x "%sysfunc(getoption(path))";
%put %sysfunc(pathname(x));
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tom,
I have the following paths for %put %sysfunc(getoption(path)) and don't see sasroot.
( "!sasext0\aacomp\sasexe" "!sasext0\statcomp\sasexe"
"!sasext0\core\sasexe" "!sasext0\tablesrvtk\sasexe"
"!sasext0\access\sasexe" "!sasext0\af\sasexe"
"!sasext0\assist\sasexe" "!sasext0\connect\sasexe"
"!sasext0\eis\sasexe" "!sasext0\ets\sasexe"
"!sasext0\fsp\sasexe" "!sasext0\graph\sasexe"
"!sasext0\stat\sasexe" "!sasext0\spdsclient\sasexe"
"!sasext0\aacomp\sasexe" "!sasext0\statcomp\sasexe"
"!sasext0\core\sasexe" "!sasext0\tablesrvtk\sasexe"
"!sasext0\access\sasexe" "!sasext0\af\sasexe"
"!sasext0\assist\sasexe" "!sasext0\connect\sasexe"
"!sasext0\eis\sasexe" "!sasext0\ets\sasexe"
"!sasext0\fsp\sasexe" "!sasext0\graph\sasexe"
"!sasext0\stat\sasexe" "!sasext0\spdsclient\sasexe"
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you are running on Windows then you can use %SYSGET() to find the value of SASROOT.
So sas.exe should be at
%let location=%sysget(sasroot)\sas.exe ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Tom, this worked
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
hi ... there must be something shorter than this ...
filename temp temp;
proc printto log=temp;
proc options option=set;
proc printto;
data _null_;
infile temp;
input @ '[SASROOT = ' text $100.;
call symputx('root',scan(text,1,'"'));
run;
%put &root;
C:\SAS_9_3\SASFoundation\9.3
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mike,
I tried this but for some reason it gives me the path of sasext1 instead of sasroot. I tried by reducing the length for the variable text to $50. and seems like thats working but didn't understand why it gives me a different path if length is $100.
Thanks