🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 09-04-2019 09:47 AM
(4442 views)
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I believe you should use 'cp' command
x "cp /x/y/z/deals&FOLDERNAME..txt /xx/yy/zz" ;
Thanks,
Jag
Jag
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I believe you should use 'cp' command
x "cp /x/y/z/deals&FOLDERNAME..txt /xx/yy/zz" ;
Thanks,
Jag
Jag
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Or try FCOPY() function .