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"
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.