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" ;
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.
LinusH ,
Thx for looking into it ,I've tried in ms-dos mode. OK
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
TimArm ,
Thx for looking into it , the xcopy returned with value 0, the other 2 returned with "2"
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.