Hi all, apologies if this has been discussed, but a search didn't turn up any leads. We have the x command authorized on our SAS server and currently trying to understand how SAS is setting the default location -- it's almost like how you would specify a 'start in..' location when running a batch program. Right now if I fire up EG and run: x "mkdir testdir"; this directory will be created in C:\SAS\SASConfig\Lev1\SASApp On the server. Would love it if this default location could be c:\temp, for instance. any help much appreciated!
did you try?
x 'cd c:\temp';
If you right click on the icon that opens the program, and select properties, you can look for the full target that the program opens under. If you were to add the following option
it will change the work folder location, and x commands will default to this location as well.
-work "C:\temp"
thank you both for your responses -- yes, the x 'cd c:\temp' works but then it requires someone including this prior to creating files in a place they shouldn't. That might be a temporary work around as an item in the autoexec, however the default behavior is what I'm trying to adjust. Also the issue here is that our EG runs on our PC clients and connects to SAS on the server, so this seems to be a server setting. The WORK and SASUSER directors are being created with no problems, and they're different from the default location where the x commands are executed.
You have to keep in mind that X 'cd ....'; will not change the working directory of the SAS workspace server, but the working directory of the shell that the workspace server invokes to execute what was given to the X statement. Once this is complete, the shell terminates and the cd is history.
If you need to change to a directory in order to execute something there, you need to do it in one action:
X 'cd xxxx;do-whatever-you-need-to-do';
That way do-whatever-you-need-to-do actually runs in xxxx.
IMO also it is a design flaw that SAS does not (per default) change to the user's home directory before invoking the workspace server
Known design flaw of SAS. See: 50345 - Changing the current working directory for the SAS® Workspace Server
Ask you platform admin to correct it as indicated by this note. The description is voor Unix translation to Windows is easy.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: