<?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: x command (copy file from one drive to another) in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/609050#M17800</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16518"&gt;@keen_sas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;While trying to copy the file from one folder to other using the infile and PIPE , i am getting the below message in log. What could be the possible reason for not getting copied.&amp;nbsp; What should be done to avoid the below text and any modification to the below code.&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;set newfile ;&lt;BR /&gt;cmd=catx(' ','copy',quote(catx('/',"&amp;amp;source",source)),quote("&amp;amp;target"));&lt;BR /&gt;infile cmd pipe filevar=cmd end=eof;&lt;BR /&gt;do while(not eof) ;&lt;BR /&gt;input;&lt;BR /&gt;put _infile_;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;/bin/ksh: copy: not found&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your error message originates from a UNIX system; from the fact that it uses ksh (Korn Shell), I take it your SAS runs on AIX.&lt;/P&gt;
&lt;P&gt;The command on AIX for a file copy is cp, not copy.&lt;/P&gt;
&lt;P&gt;Note that you only need the quote functions if your path or file names contain blanks (something which any UNIX admin truly abhors).&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2019 14:07:41 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-12-03T14:07:41Z</dc:date>
    <item>
      <title>x command (copy file from one drive to another)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/605584#M17219</link>
      <description>&lt;P&gt;I'm new to the x command and am following a previous employee's code that copies a file (thedata.mdb) from a location on their A drive to a new folder on their A drive.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option noxwait;

x "net use /yes A:\\HOST\SHARE\PATH1";
x "cd PATH2\'My Studies'\SAS";

x "md quarterly&amp;amp;sysdate";
%let foldername=quarterly&amp;amp;sysdate;
x "cd PATH2\'My Studies'\SAS&amp;amp;foldername";

x "md site1";

x %unquote(%str(%"copy A:\\HOST\SHARE\DATA\thedata.mdb
                  \\PATH2\'My Studies'\SAS\&amp;amp;foldername\site1%"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have read-only access to the A drive, so how do I modify this program so that the file is copied from their A drive to a newly created folder on my B drive (B:\\HOST\SHARE\site1\mydata.mdb)? I'd also like the the quarterly folder directory to be B:\\HOST\SHARE\quarterly20OCT19.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 00:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/605584#M17219</guid>
      <dc:creator>bkq32</dc:creator>
      <dc:date>2019-11-20T00:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: x command (copy file from one drive to another)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/605626#M17229</link>
      <description>&lt;P&gt;Could you please try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
x "cp A:\\HOST\SHARE\DATA\thedata.mdb   \\PATH2\'My Studies'\SAS\&amp;amp;foldername\site1";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Nov 2019 07:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/605626#M17229</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-11-20T07:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: x command (copy file from one drive to another)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/605654#M17233</link>
      <description>&lt;P&gt;You should run all your external commands with the filename pipe method to see the responses:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe "net use /yes A:\\HOST\SHARE\PATH1 2&amp;gt;&amp;amp;1";

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can see all responses (standard and error output) in the SAS log. This makes it easier to diagnose each single command.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 09:48:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/605654#M17233</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-20T09:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: x command (copy file from one drive to another)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/609034#M17796</link>
      <description>&lt;P&gt;While trying to copy the file from one folder to other using the infile and PIPE , i am getting the below message in log. What could be the possible reason for not getting copied.&amp;nbsp; What should be done to avoid the below text and any modification to the below code.&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;set newfile ;&lt;BR /&gt;cmd=catx(' ','copy',quote(catx('/',"&amp;amp;source",source)),quote("&amp;amp;target"));&lt;BR /&gt;infile cmd pipe filevar=cmd end=eof;&lt;BR /&gt;do while(not eof) ;&lt;BR /&gt;input;&lt;BR /&gt;put _infile_;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;/bin/ksh: copy: not found&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 13:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/609034#M17796</guid>
      <dc:creator>keen_sas</dc:creator>
      <dc:date>2019-12-03T13:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: x command (copy file from one drive to another)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/609050#M17800</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16518"&gt;@keen_sas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;While trying to copy the file from one folder to other using the infile and PIPE , i am getting the below message in log. What could be the possible reason for not getting copied.&amp;nbsp; What should be done to avoid the below text and any modification to the below code.&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;set newfile ;&lt;BR /&gt;cmd=catx(' ','copy',quote(catx('/',"&amp;amp;source",source)),quote("&amp;amp;target"));&lt;BR /&gt;infile cmd pipe filevar=cmd end=eof;&lt;BR /&gt;do while(not eof) ;&lt;BR /&gt;input;&lt;BR /&gt;put _infile_;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;/bin/ksh: copy: not found&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your error message originates from a UNIX system; from the fact that it uses ksh (Korn Shell), I take it your SAS runs on AIX.&lt;/P&gt;
&lt;P&gt;The command on AIX for a file copy is cp, not copy.&lt;/P&gt;
&lt;P&gt;Note that you only need the quote functions if your path or file names contain blanks (something which any UNIX admin truly abhors).&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 14:07:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/609050#M17800</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-03T14:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: x command (copy file from one drive to another)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/609125#M17820</link>
      <description>&lt;P&gt;Thank you, everyone. I ended up doing this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option noxwait;

%let foldername=quarterly&amp;amp;systdate;

x "md B:\HOST\SHARE\site1";
x "md B:\HOST\SHARE\&amp;amp;foldername";
x %unquote(%str(%'copy A:\HOST\SHARE\site1\thedata.mdb
                       B:\HOST\SHARE\site1\thedata.mdb%')); /* The actual path has spaces */&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Dec 2019 17:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/x-command-copy-file-from-one-drive-to-another/m-p/609125#M17820</guid>
      <dc:creator>bkq32</dc:creator>
      <dc:date>2019-12-03T17:40:46Z</dc:date>
    </item>
  </channel>
</rss>

