BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
3 REPLIES 3
RichardH_sas
SAS Employee
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.

http://support.sas.com/kb/17/490.html

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).
ChrisHemedinger
Community Manager
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 http://support.sas.com/documentation/cdl/en/bisecag/61133/HTML/default/a003181427.htm.

Chris
Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
DF
Fluorite | Level 6 DF
Fluorite | Level 6
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;
run;

This will run the command "ls -al" on your box, and send the console output to the dataset specified.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3471 views
  • 0 likes
  • 4 in conversation