BookmarkSubscribeRSS Feed
bbb_NG
Fluorite | Level 6


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" ;

4 REPLIES 4
LinusH
Tourmaline | Level 20

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
bbb_NG
Fluorite | Level 6

LinusH ,

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

TimArm
Obsidian | Level 7

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

bbb_NG
Fluorite | Level 6

TimArm ,

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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