SASUnit Examples  Version 1.2.1
_sasunit_copydir.sas
Go to the documentation of this file.
1 
23 /* change history
24  02.10.2008 NA Anpassung an Linux
25 */
26 
27 %macro _sasunit_copyDir(
28  i_from
29  ,i_to
30 );
31 
32 %if &sysscp. = WIN %then %do;
33 
34  /* save and modify os command options */
35  %local xwait xsync xmin;
36  %let xwait=%sysfunc(getoption(xwait));
37  %let xsync=%sysfunc(getoption(xsync));
38  %let xmin =%sysfunc(getoption(xmin));
39  options noxwait xsync xmin;
40 
41  %let i_from = %qsysfunc(translate(&i_from,\,/));
42  %let i_to = %qsysfunc(translate(&i_to ,\,/));
43 
44  /*-- XCOPY
45  /E copy directories (even empty ones) and files recursively
46  /I do not prompt before file or directory creation
47  /Y do not prompt before overwriting target
48  --*/
49  %sysexec
50  xcopy
51  "&i_from"
52  "&i_to"
53  /E /I /Y
54  ;
55  %put sysrc=&sysrc;
56  options &xwait &xsync &xmin;
57 %end;
58 
59 %else %if &sysscp. = LINUX %then %do;
60  %SYSEXEC(cp -R &i_from. &i_to.);
61 %end;
62 
63 %mend _sasunit_copyDir;