BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

I see no errors in the logs but  the  file  just not copying  into the second  folder

Is this the right command?

 

x "copy /x/y/z/deals&FOLDERNAME..txt

/xx/yy/zz/deals&FOLDERNAME..txt" ;

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16

I believe you should use 'cp' command

 

x "cp /x/y/z/deals&FOLDERNAME..txt /xx/yy/zz" ;
Thanks,
Jag

View solution in original post

4 REPLIES 4
Jagadishkatam
Amethyst | Level 16

I believe you should use 'cp' command

 

x "cp /x/y/z/deals&FOLDERNAME..txt /xx/yy/zz" ;
Thanks,
Jag
Kurt_Bremser
Super User

If you use the X statement, you should check the automatic macro variable &sysrc afterwards to see if the command succeeded.

 

To make the responses from the command visible in SAS, use the filename pipe method:

filename oscmd pipe "cp /x/y/z/deals&FOLDERNAME..txt /xx/yy/zz/deals&FOLDERNAME..txt 2>&1";

data responses;
length response $256;
infile oscmd;
input;
response = _infile_;
put _infile_;
run;

This will keep the responses both in the dataset and the SAS log.

The "2>&1" construct redirects error output into the pipe.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3900 views
  • 3 likes
  • 4 in conversation