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.

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 6001 views
  • 3 likes
  • 4 in conversation