<?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: Copy file from one directory to another using X command in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/317526#M69537</link>
    <description>&lt;P&gt;Hi Shmuel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Iam still stucked in this. Is there any other way to rename the file . Instead to copy to different folder? Just to rename the file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advice&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2016 09:24:35 GMT</pubDate>
    <dc:creator>ambadi007</dc:creator>
    <dc:date>2016-12-08T09:24:35Z</dc:date>
    <item>
      <title>Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316674#M69246</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to copy the file which created in run getting an error saying the directory specified is incorrect.I am trying to achieve it in macros and while copying i am removing the date string as well.Please have a look the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let rptpath = 'R:\CDW Reporting\Ad-Hoc\WR#_JAS0031 -Walls Regional Hospital Hainey\Data Out\';
%let rptname = 'Walls Regional Hospital Hainey Report';
%let rptdate = today();
%let rptdatefmt = YYMMDDd10.;
%let path=&amp;amp;rptpath;

%put &amp;amp;report;

%let path=&amp;amp;rptpath;
%let name=&amp;amp;rptname ;
%let date=&amp;amp;rptdate;
%let format=&amp;amp;rptdatefmt;


X'COPY "&amp;amp;path\&amp;amp;name || ' ' || put(&amp;amp;date,&amp;amp;format).xlsx" "C:\Users\UCS1MKP\Desktop\y\&amp;amp;rptname.xlsx"';

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Dec 2016 12:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316674#M69246</guid>
      <dc:creator>ambadi007</dc:creator>
      <dc:date>2016-12-05T12:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316679#M69248</link>
      <description>&lt;P&gt;Do not use quotes in&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let rptpath = 'R:\CDW Reporting\Ad-Hoc\WR#_JAS0031 -Walls Regional Hospital Hainey\Data Out\';
%let rptname = 'Walls Regional Hospital Hainey Report';
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Instead use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let rptpath = R:\CDW Reporting\Ad-Hoc\WR#_JAS0031 -Walls Regional Hospital Hainey\Data Out\;
%let rptname = Walls Regional Hospital Hainey Report;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Dec 2016 13:05:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316679#M69248</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-05T13:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316686#M69252</link>
      <description>&lt;P&gt;Why not write the file directly to the location you want?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 13:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316686#M69252</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-12-05T13:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316688#M69253</link>
      <description>&lt;P&gt;Take out the single quotes:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token macroname"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%let&lt;/SPAN&gt; rptpath &amp;nbsp;&amp;nbsp;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;R:\CDW Reporting\Ad-Hoc\WR#_JAS0031 -Walls Regional Hospital Hainey\Data Out\&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token macroname"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%let&lt;/SPAN&gt; rptname &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;Walls Regional Hospital Hainey Report&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;otherwise they become part of the macro variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;Your line:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; %put &amp;amp;report;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;you havn't defined a value to the macro variable &lt;STRONG&gt;&amp;amp;report.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;The &lt;STRONG&gt;X&lt;/STRONG&gt; statement should be enclosed in a data step:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;You probably meant to write:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let rptpath = R:\CDW Reporting\Ad-Hoc\WR#_JAS0031 -Walls Regional Hospital Hainey\Data Out\;&lt;BR /&gt;%let rptname = Walls Regional Hospital Hainey Report;&lt;BR /&gt;%let rptdate = today();&lt;BR /&gt;%let rptdatefmt = YYMMDDd10.;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data _NULL_;&lt;BR /&gt; cmd = "COPY &amp;amp;rptpath.&amp;amp;name" || put(&amp;amp;rptdate,&amp;amp;rptdatefmt) || ".xlsx C:\Users\UCS1MKP\Desktop\y\&amp;amp;rptname..xlsx";&lt;BR /&gt; call system(cmd);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pay attention: at&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;&amp;amp;rptname..xlsx&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I used two dots, the 1st to assign the end of the macro varaible&amp;nbsp;and the 2nd as part of the name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 13:20:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316688#M69253</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-12-05T13:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316778#M69275</link>
      <description>&lt;P&gt;Hi Shmuel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the code but still I am getting the error while copying the error "The system cannnot find the file specified"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let rptpath = R:\CDW Reporting\Ad-Hoc\WR#_JAS0031 -Walls Regional Hospital Hainey\Data Out\;
%let rptname = Walls Regional Hospital Hainey Report;
%let rptdate = today();
%let rptdatefmt = YYMMDDd10.;


data _NULL_;
 cmd = "COPY &amp;amp;rptpath.&amp;amp;rptname" ||put(&amp;amp;rptdate,&amp;amp;rptdatefmt) || ".xlsx C:\Users\UCS1MKP\Desktop\y\&amp;amp;rptname..xlsx";
 call system(cmd);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there any problem with this code I used?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 16:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316778#M69275</guid>
      <dc:creator>ambadi007</dc:creator>
      <dc:date>2016-12-05T16:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316782#M69276</link>
      <description>&lt;P&gt;I suggest you put the command CMD to the log and copy it in a DOS / command window.&lt;/P&gt;
&lt;P&gt;Does it work ? Is the path, name, etc - realy combine the full path and report name you want to copy ?&lt;/P&gt;
&lt;P&gt;Using X or call system should run same code as if it was run manually.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; _NULL_&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 cmd &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"COPY &amp;amp;rptpath.&amp;amp;rptname"&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;||&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;rptdate&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;rptdatefmt&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;||&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;".xlsx C:\Users\UCS1MKP\Desktop\y\&amp;amp;rptname..xlsx"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
put cmd=;&lt;BR /&gt; /* call &lt;SPAN class="token function"&gt;system&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;cmd&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;; */&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;maybe there are imbeded blanks to remove.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 17:10:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316782#M69276</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-12-05T17:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316794#M69277</link>
      <description>&lt;P&gt;Your command resolves to&lt;/P&gt;
&lt;P&gt;COPY R:\CDW Reporting\Ad-Hoc\WR#_JAS0031 -Walls Regional Hospital Hainey\Data Out\Walls Regional Hospital Hainey Report2016-12-05.xlsx C:\Users\UCS1MKP\Desktop\y\Walls Regional Hospital Hainey Report.xlsx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The copy command is&amp;nbsp;likely&amp;nbsp;not going to like SPACES inside the file names unless the whole file is enclosed in quotes.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 17:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316794#M69277</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-12-05T17:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316826#M69290</link>
      <description>&lt;P&gt;I have checked in windows command window, you need doble quotes to enclose path or file name with embeded spaces.&lt;/P&gt;
&lt;P&gt;Then change the code into:&lt;/P&gt;
&lt;PRE class="  language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; _NULL_&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 cmd &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"COPY ""&amp;amp;rptpath.&amp;amp;rptname"&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;||&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;rptdate&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;rptdatefmt&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;||&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;".xlsx"" ""C:\Users\UCS1MKP\Desktop\y\&amp;amp;rptname..xlsx"" "&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt; cmd&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token comment"&gt;/* call system(cmd); */&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Dec 2016 19:55:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316826#M69290</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-12-05T19:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316829#M69291</link>
      <description>If need try run the command in CMD window and &lt;BR /&gt;add quoutes until it works, then adapt the SAS code.</description>
      <pubDate>Mon, 05 Dec 2016 19:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316829#M69291</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-12-05T19:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316952#M69335</link>
      <description>&lt;P&gt;Bottom line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DO.NOT.USE.BLANKS.IN.FILENAMES.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use underlines instead. Blanks serve no purpose that can't be handled with underlines and only cause additional work and often lots of grief.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2016 07:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/316952#M69335</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-06T07:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/317526#M69537</link>
      <description>&lt;P&gt;Hi Shmuel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Iam still stucked in this. Is there any other way to rename the file . Instead to copy to different folder? Just to rename the file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advice&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 09:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/317526#M69537</guid>
      <dc:creator>ambadi007</dc:creator>
      <dc:date>2016-12-08T09:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/317559#M69556</link>
      <description>&lt;P&gt;You probably can force using file name by replacing spaces into underscores&lt;/P&gt;
&lt;P&gt;but, can you force the system to do the same upon the path name ?&lt;BR /&gt;That is creating a new path without embeded spaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have the syntax to rename it by windows command line then it is possible&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to submit such command by SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running sas UE (university edition) on linux and cannot test it on windows,&lt;/P&gt;
&lt;P&gt;even not use X or call system.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 11:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/317559#M69556</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-12-08T11:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/317601#M69567</link>
      <description>&lt;P&gt;Hi this code will handle files with spaces in name of the file, if you are still looking for a solution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;X %unquote(%str(%'copy "C:\file with spaces.txt" "C:\file with spaces2.txt" /y%'));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, take the advice given and try to avoid such file names.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 13:41:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/317601#M69567</guid>
      <dc:creator>chrej5am</dc:creator>
      <dc:date>2016-12-08T13:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/322095#M71225</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42231"&gt;@chrej5am&lt;/a&gt;&amp;nbsp;- I'm using SAS UE on linux, so I cannot test your code (can't use X command),&lt;/P&gt;
&lt;P&gt;but I'm &lt;U&gt;qurious to know&lt;/U&gt;, would next code work too?&lt;/P&gt;
&lt;P&gt;or do I need replace single quotes with double quotes and vice versa:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%let file1 = C:\file with spaces.txt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%let file2 = C:\file with spaces2.txt&amp;nbsp;;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;X %unquote(%str(%'copy "&amp;amp;file1" "&amp;amp;file2" /y%'));&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks ahead&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 10:12:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/322095#M71225</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-03T10:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Copy file from one directory to another using X command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/322107#M71234</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;Yes the code you posted is also valid. No errors given, text file copied.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 11:56:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-file-from-one-directory-to-another-using-X-command/m-p/322107#M71234</guid>
      <dc:creator>chrej5am</dc:creator>
      <dc:date>2017-01-03T11:56:45Z</dc:date>
    </item>
  </channel>
</rss>

