- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have to copy 14K files from one directory to another. when using the below code, the cmd window opens 14K times and this is interrupting from doing further work.
1. How to make it work with out interrupting the user?
2. If the files are already presnt in destination folder, either delete them or overwrite them. The following code popups cmd window to manually key in the response by the user.
How to achieve above two conditions?
options noxwait noxsync;
data _null_;
%do i=1 %to &count.;
%sysExec xcopy "&landing_zone.\&&memname&i" "&dest.\";
%end;
run;
proc printto;
run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You're passing a system command and need to find the relevant system option.
For XCOPY that appears to be /Y
See the Microsoft documentation, here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried specifying the XMIN Option?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
No ,havent tried
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
never tried that.
Looping lets me choose only the files of interest. I'm not sure how /s works.
if there are
abc.txt
pqr.txt
xyz.txt
and I want to choose only pqr.txt and xyz.txt based on some conditions, I will pass the two file names into a macro array and loop them to move to a new folder.
Imagine i had to move 14k files out of 50k
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You're passing a system command and need to find the relevant system option.
For XCOPY that appears to be /Y
See the Microsoft documentation, here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Xcopy.exe Application error popup.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Like I mentioned you're using Windows command, SAS is just passing it to the system. Figure out what works in the system and that's a Windows question, not a SAS question.
Then incorporate that solution here.