<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: using robocopy in SAS to copy paths with special characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/using-robocopy-in-SAS-to-copy-paths-with-special-characters/m-p/437644#M109017</link>
    <description>&lt;P&gt;Look up the FCOPY function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/172904"&gt;@Billybob73&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I'm using this macro to copy qlikview files with folder structure&amp;nbsp;from one location to the other&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro qvwrobocopydir (dir, archive);&lt;BR /&gt;%let datum = %sysfunc(date(),date7.);&lt;BR /&gt;&amp;nbsp; filename kopie pipe "robocopy %superq(dir) %superq(archive) *.qvw /MIR /Z /LOG:%superq(archive)\robocopy_&amp;amp;datum..log";&lt;BR /&gt;&amp;nbsp; data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile kopie;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put _infile_;&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;%mend;&lt;BR /&gt;%qvwrobocopydir(f:\mainroot\Research &amp;amp; Development, g:\PROD\qvw_backup);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Despite the fact the folder f:\mainroot\Research &amp;amp; Development is used within the superq function the copy does not take place.&lt;/P&gt;
&lt;P&gt;The &amp;amp; in the folder is the showstopper.&lt;/P&gt;
&lt;P&gt;What can I do to circumvent this ? I already tried %nrstr(&amp;nbsp; but this does not help either.&lt;/P&gt;
&lt;P&gt;Also I have access to both paths.&lt;/P&gt;
&lt;P&gt;Any suggestions ?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;B&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2018 15:43:06 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-15T15:43:06Z</dc:date>
    <item>
      <title>using robocopy in SAS to copy paths with special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-robocopy-in-SAS-to-copy-paths-with-special-characters/m-p/437604#M108996</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I'm using this macro to copy qlikview files with folder structure&amp;nbsp;from one location to the other&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro qvwrobocopydir (dir, archive);&lt;BR /&gt;%let datum = %sysfunc(date(),date7.);&lt;BR /&gt;&amp;nbsp; filename kopie pipe "robocopy %superq(dir) %superq(archive) *.qvw /MIR /Z /LOG:%superq(archive)\robocopy_&amp;amp;datum..log";&lt;BR /&gt;&amp;nbsp; data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile kopie;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put _infile_;&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;%mend;&lt;BR /&gt;%qvwrobocopydir(f:\mainroot\Research &amp;amp; Development, g:\PROD\qvw_backup);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Despite the fact the folder f:\mainroot\Research &amp;amp; Development is used within the superq function the copy does not take place.&lt;/P&gt;&lt;P&gt;The &amp;amp; in the folder is the showstopper.&lt;/P&gt;&lt;P&gt;What can I do to circumvent this ? I already tried %nrstr(&amp;nbsp; but this does not help either.&lt;/P&gt;&lt;P&gt;Also I have access to both paths.&lt;/P&gt;&lt;P&gt;Any suggestions ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 14:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-robocopy-in-SAS-to-copy-paths-with-special-characters/m-p/437604#M108996</guid>
      <dc:creator>Billybob73</dc:creator>
      <dc:date>2018-02-15T14:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: using robocopy in SAS to copy paths with special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-robocopy-in-SAS-to-copy-paths-with-special-characters/m-p/437617#M109002</link>
      <description>&lt;P&gt;Well, I hate to point out the obvious, but putting special characters in paths is a pretty bad thing to do from both programming an system point of view.&amp;nbsp; Maxim 44:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a note, you could just stream text files through a datastep to effect a copy.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 15:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-robocopy-in-SAS-to-copy-paths-with-special-characters/m-p/437617#M109002</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-15T15:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: using robocopy in SAS to copy paths with special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-robocopy-in-SAS-to-copy-paths-with-special-characters/m-p/437644#M109017</link>
      <description>&lt;P&gt;Look up the FCOPY function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/172904"&gt;@Billybob73&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I'm using this macro to copy qlikview files with folder structure&amp;nbsp;from one location to the other&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro qvwrobocopydir (dir, archive);&lt;BR /&gt;%let datum = %sysfunc(date(),date7.);&lt;BR /&gt;&amp;nbsp; filename kopie pipe "robocopy %superq(dir) %superq(archive) *.qvw /MIR /Z /LOG:%superq(archive)\robocopy_&amp;amp;datum..log";&lt;BR /&gt;&amp;nbsp; data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile kopie;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put _infile_;&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;%mend;&lt;BR /&gt;%qvwrobocopydir(f:\mainroot\Research &amp;amp; Development, g:\PROD\qvw_backup);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Despite the fact the folder f:\mainroot\Research &amp;amp; Development is used within the superq function the copy does not take place.&lt;/P&gt;
&lt;P&gt;The &amp;amp; in the folder is the showstopper.&lt;/P&gt;
&lt;P&gt;What can I do to circumvent this ? I already tried %nrstr(&amp;nbsp; but this does not help either.&lt;/P&gt;
&lt;P&gt;Also I have access to both paths.&lt;/P&gt;
&lt;P&gt;Any suggestions ?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;B&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 15:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-robocopy-in-SAS-to-copy-paths-with-special-characters/m-p/437644#M109017</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-15T15:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: using robocopy in SAS to copy paths with special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-robocopy-in-SAS-to-copy-paths-with-special-characters/m-p/437740#M109058</link>
      <description>&lt;P&gt;I think you need to pass the quotes down to the DOS command (when you invoke the macro) for the path spec to be formatted for Windows.&amp;nbsp; Here's the code snippet I tried:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    %macro qvwrobocopydir (dir, archive);
2    %let datum = %sysfunc(date(),date7.);
3      filename kopie pipe "robocopy %superq(dir) %superq(archive) *.qvw /MIR /NP";
4      data _null_;
5        infile kopie;
6        input;
7        put _infile_;
8      run;
9    %mend;
10   %qvwrobocopydir("C:\temp\R &amp;amp; D", "C:\temp\backup");

NOTE: The infile KOPIE is:
      Unnamed Pipe Access Device,
      PROCESS=robocopy "C:\temp\R &amp;amp; D" "C:\temp\backup" *.qvw /MIR /NP,
      RECFM=V,LRECL=32767


-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

  Started : Thursday, February 15, 2018 2:43:19 PM
   Source : C:\temp\R &amp;amp; D\
     Dest : C:\temp\backup\

    Files : *.qvw
	
  Options : /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /NP /R:1000000 /W:30

------------------------------------------------------------------------------

	                   3	C:\temp\R &amp;amp; D\
	    New File  		   14378	test1.qvw
	    New File  		  104890	test2.qvw
	    New File  		  100536	test3.qvw

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         3         3         0         0         0         0
   Bytes :   214.6 k   214.6 k         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00


   Speed :            24422666 Bytes/sec.
   Speed :            1397.476 MegaBytes/min.
   Ended : Thursday, February 15, 2018 2:43:19 PM
NOTE: 33 records were read from the infile KOPIE.
      The minimum record length was 0.
      The maximum record length was 81.
NOTE: DATA statement used (Total process time):
      real time           0.11 seconds
      user cpu time       0.00 seconds
      system cpu time     0.01 seconds
      memory              1086.53k
      OS Memory           9196.00k
      Timestamp           02/15/2018 02:43:19 PM
      Step Count                        1  Switch Count  0
&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Feb 2018 19:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-robocopy-in-SAS-to-copy-paths-with-special-characters/m-p/437740#M109058</guid>
      <dc:creator>DaveHorne</dc:creator>
      <dc:date>2018-02-15T19:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: using robocopy in SAS to copy paths with special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-robocopy-in-SAS-to-copy-paths-with-special-characters/m-p/437893#M109118</link>
      <description>&lt;P&gt;Thanks Dave ! This works !&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 06:27:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-robocopy-in-SAS-to-copy-paths-with-special-characters/m-p/437893#M109118</guid>
      <dc:creator>Billybob73</dc:creator>
      <dc:date>2018-02-16T06:27:53Z</dc:date>
    </item>
  </channel>
</rss>

