Sometimes, you might need to know the path to the temporary work directory that SAS uses. There are at least two ways to do it.
First method is via point-and-click in Windows environment. Right click on the icon of work in SAS and choose “Property”.
The second method is to use SAS syntax. For example,
proc options option = work; run;
If you want to pass this information to a SAS program or what if we are not in Windows environment, here is how to do it via syntax. Notice that the code is not case-sensitive.
%put %sysfunc(getoption(work)); 1 %put %sysfunc(getoption(work)); c:saswork_TD308
We can also create a macro variable to store the location for future use.
%let a = %sysfunc(getoption(work)); %put &a;3 %let a = %sysfunc(getoption(work)); 4 %put &a; c:saswork_TD308
For more information on using sas macro function %sysfunc, visit SAS’s page on %SYSFUNC and %QSYSFUNC Functions