Desktop productivity for business analysts and programmers

X command

Not applicable
Posts: 0

X command

Dear all,

The x command is not working in my EG client.

I tried to delete a file which exists in SAS Server (a remote machine) from my local EG Client. I could not delete the file and even I didn't get any errors or warnings in logs.

I've also checked whether the xcmd option is valid in my session and this option is valid.

I tried to use

x 'del \Q \F \\serverpath\filename';

my domain Id has the read,write or modify permissions only the above path(shared location)

But the file isn't deleted in the server location. Even When I tried to use local server path as

x 'del \Q \F F:\filename'; I could not delete it.

Is there any user permission I need to configure in Management console to execute the command or is there any configuration required?

Please provide the solution ASAP.
SAS Employee
Posts: 149

Re: X command

Posted in reply to deleted_user
X commands are disabled by default in EG. I turned up the following note which might be helpful. It is a bit dated... looks like it references EG 3.

FYI, there's a Data task called Delete Data Set and Formats. If all you need to do is delete a data set in a library on a SAS server, that will do the trick (assuming you have appropriate permissions to delete the table).
Community Manager
Posts: 3,462

Re: X command

Posted in reply to deleted_user
As Richard said, you need to make sure that XCMD is permitted (-allowxcmd) in your workspace server definition. If you make a change in SAS Management Console to enable this, you usually have to restart the object spawner to have it take effect.

You might try:

X 'dir';

Just to make sure that X commands are working.

Once you've established that X commands work, there are these additional considerations:

- does the user identity (account) that launched the SAS session have the appropriate permissions on the server machine to delete these files?

- if you are trying to access network resources (using the UNC \\server notation), Windows might get in your way if delegation is not enabled. By default, the server machine cannot pass your identity along to another server machine on the network to accomplish some work on your behalf; this needs to be enabled via an ActiveDirectory setting by an admin. See

Frequent Contributor
Frequent Contributor
Posts: 94

Re: X command

Posted in reply to deleted_user
I found the below code when googling for a similar issue in the past. It's quite useful for working out what's actually happening with your X command:

filename whatever pipe "ls -al";
data command_output;
infile whatever truncover;
input value $ 1-180;

This will run the command "ls -al" on your box, and send the console output to the dataset specified.
Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation