x statement - moving folder from one server to another

Reply
Occasional Contributor
Posts: 5

x statement - moving folder from one server to another

I am able to use the x statement in SAS to move a folder from one drive to another, but only for certain drives. For example this code works to move a folder from my P drive to my S drive:

options noxwait ;

x "move P:\analysts\Alison\something S:\BCD\";

x "exit";

But this code does not work to move the same folder on the P drive to my M drive:

options noxwait ;

x "move P:\analysts\Alison\something M:\ED\";

x "exit";

Both locations do exist, and I am not sure what is special about the M drive that does not allow me to move a folder to it. When I manually copy/paste, there are no issues. Does anyone have insight?

Thanks,
Alison

UPDATE: I just learned the my S and P drive are on the same server, but my M drive is on a different server. So now the question has changed to moving a folder from one server to another. Is this possible?

PROC Star
Posts: 1,229

Re: x statement - moving folder from one server to another

Hi Alison,

Assume this is on Windows?

I'm not a DOS expert, so don't know the answer.

But suggest you try to get this working at command prompt (start->run->CMD in win XP).

If you can get the command working entering into the command prompt, it should work via X command from SAS.  If you can't get it working at the command prompt, then SAS can't help.

If it's hard to get it working from the command prompt, would try give it the full UNC path for the file //servername/...  and after that I would start trolling windows support groups.

HTH

Occasional Contributor
Posts: 5

Re: x statement - moving folder from one server to another

I discovered that you can't use the move command to move files between servers, but you can use the xcopy command.

options noxwait;

x "xcopy P:\analysts\Alison\test M:\ED\test /s/e";

x "exit";



Microsoft Corporation

Ask a Question
Discussion stats
  • 2 replies
  • 702 views
  • 0 likes
  • 2 in conversation