SASUnit Examples  Version 1.3.0
windows/_copydir.sas
Go to the documentation of this file.
1 
24 %macro _copyDir (i_from
25  ,i_to
26  );
27 
28  %LOCAL l_i_from l_i_to;
29 
30  /* save and modify os command options */
31  %local xwait xsync xmin;
32  %let xwait=%sysfunc(getoption(xwait));
33  %let xsync=%sysfunc(getoption(xsync));
34  %let xmin =%sysfunc(getoption(xmin));
35  options noxwait xsync xmin;
36 
37  %let i_from = %qsysfunc(translate(&i_from,\,/));
38  %let i_to = %qsysfunc(translate(&i_to ,\,/));
39 
40  /*-- XCOPY
41  /E copy directories (even empty ones) and files recursively
42  /I do not prompt before file or directory creation
43  /Y do not prompt before overwriting target
44  --*/
45  %sysexec
46  xcopy
47  "&i_from"
48  "&i_to"
49  /E /I /Y
50  ;
51  %put &g_note.(SASUNIT): sysrc=&sysrc;
52  options &xwait &xsync &xmin;
53 
54 %mend _copyDir;