Copy/move external file,doesn't work.

Reply
Frequent Contributor
Posts: 99

Copy/move external file,doesn't work.


Dear all,

     3 sentences used. only the first worked, but no error message occurred to the later 2,

     can anyone give a hand?Thx.

%sysExec  xcopy "\\133.9.206.139\bdp\43430710\Test\a.xls" "\\133.9.206.139\bdp\43430710\Test\test1" ;

%sysExec  move "\\133.9.206.139\bdp\43430710\Test\a.xls" "\\133.9.206.139\bdp\43430710\Test\test1" ;

%sysExec  copy "\\133.9.206.139\bdp\43430710\Test\a.xls" "\\133.9.206.139\bdp\43430710\Test\test1" ;

Super User
Posts: 5,257

Re: Copy/move external file,doesn't work.

Have you tried these outside SAS?

OS rc is not returned to using this method. To catch a OS return code, try FILENAME PIPE instead.

Data never sleeps
Frequent Contributor
Posts: 99

Re: Copy/move external file,doesn't work.

LinusH ,

     Thx for looking into it ,I've tried in ms-dos mode. OK

Contributor
Posts: 29

Re: Copy/move external file,doesn't work.

Hello. Try this and check the values of rc:

data rc;

rc=system("xcopy \\133.9.206.139\bdp\43430710\Test\a.xls \\133.9.206.139\bdp\43430710\Test\test1");

output;

rc=system("move \\133.9.206.139\bdp\43430710\Test\a.xls \\133.9.206.139\bdp\43430710\Test\test1");

output;

rc=system("copy \\133.9.206.139\bdp\43430710\Test\a.xls \\133.9.206.139\bdp\43430710\Test\test1");

output;

run;

Once you get something that works you can try it again in %sysExec, or keep the above with data _NULL_ instead of data rc (although it can be quite useful to have a work dataset where you can check the return codes).

If you have a drive mapping for \\133.9.206.139\bdp then try using that instead.

Tim

Frequent Contributor
Posts: 99

Re: Copy/move external file,doesn't work.

TimArm ,

Thx for  looking into it , the xcopy returned with value 0, the other 2 returned with "2"

Ask a Question
Discussion stats
  • 4 replies
  • 310 views
  • 0 likes
  • 3 in conversation