04-08-2014 05:38 PM
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!
04-08-2014 07:03 PM
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.
04-08-2014 08:06 PM
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.
04-09-2014 03:48 AM
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
04-09-2014 01:28 AM
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.