<?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: How to copy from a unix directory to another in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-copy-from-a-unix-directory-to-another/m-p/815845#M321999</link>
    <description>&lt;P&gt;How about doing this without X command?&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://core.sasjs.io/mp__copyfolder_8sas.html" target="_blank"&gt;https://core.sasjs.io/mp__copyfolder_8sas.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 May 2022 14:33:04 GMT</pubDate>
    <dc:creator>AllanBowe</dc:creator>
    <dc:date>2022-05-31T14:33:04Z</dc:date>
    <item>
      <title>How to copy from a unix directory to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-copy-from-a-unix-directory-to-another/m-p/815802#M321980</link>
      <description>&lt;P&gt;Hello I have this piece of code below where I am trying to copy ALL files from one directory to another, but the nothing happens when I run the code. Any idea why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let RacineRun = /sasprep/fit/fit_1/run/azi/d2d/w6;
%let RacineBloctel = /particuliers/bloctel/fichiers;
%let REP_BLOCTEL_RETOUR = /sasprep/prep/cft/w6/BLOCTEL/ENTRANT;

x 'cp "&amp;amp;rep_bloctel_retour./*" "&amp;amp;RacineRun./&amp;amp;RacineBloctel./archive"';&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 May 2022 10:29:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-copy-from-a-unix-directory-to-another/m-p/815802#M321980</guid>
      <dc:creator>MILKYLOVE</dc:creator>
      <dc:date>2022-05-31T10:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy from a unix directory to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-copy-from-a-unix-directory-to-another/m-p/815804#M321981</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/404650"&gt;@MILKYLOVE&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello I have this piece of code below where I am trying to copy ALL files from one directory to another, but the nothing happens when I run the code. Any idea why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let RacineRun = /sasprep/fit/fit_1/run/azi/d2d/w6;
%let RacineBloctel = /particuliers/bloctel/fichiers;
%let REP_BLOCTEL_RETOUR = /sasprep/prep/cft/w6/BLOCTEL/ENTRANT;

x 'cp "&amp;amp;rep_bloctel_retour./*" "&amp;amp;RacineRun./&amp;amp;RacineBloctel./archive"';&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The macro processor will ignore strings that are bounded by single quote characters.&lt;/P&gt;
&lt;P&gt;Use double quote characters instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also normally avoid the X command as you have no way to check any messages it might be trying to send you.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  input "cp ""&amp;amp;rep_bloctel_retour./*"" ""&amp;amp;RacineRun./&amp;amp;RacineBloctel./archive""" pipe;
  input;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 May 2022 10:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-copy-from-a-unix-directory-to-another/m-p/815804#M321981</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-05-31T10:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy from a unix directory to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-copy-from-a-unix-directory-to-another/m-p/815845#M321999</link>
      <description>&lt;P&gt;How about doing this without X command?&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://core.sasjs.io/mp__copyfolder_8sas.html" target="_blank"&gt;https://core.sasjs.io/mp__copyfolder_8sas.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 14:33:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-copy-from-a-unix-directory-to-another/m-p/815845#M321999</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-05-31T14:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy from a unix directory to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-copy-from-a-unix-directory-to-another/m-p/815991#M322051</link>
      <description>&lt;PRE&gt;x 'cp "&amp;amp;rep_bloctel_retour./&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;*.*&lt;/STRONG&gt;&lt;/FONT&gt;" "&amp;amp;RacineRun./&amp;amp;RacineBloctel./archive"';&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Jun 2022 04:50:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-copy-from-a-unix-directory-to-another/m-p/815991#M322051</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-06-01T04:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy from a unix directory to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-copy-from-a-unix-directory-to-another/m-p/815998#M322054</link>
      <description>&lt;P&gt;KISS (Keep It Simple, Stupid) principle: since your path names have no blanks, no quotes are needed around them.&lt;/P&gt;
&lt;P&gt;Macro triggers will not be resolved inside single quotes.&lt;/P&gt;
&lt;P&gt;And the X statement is a very crude tool, not giving you any more information than the return code in &amp;amp;SYSRC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In light of this, do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let RacineRun = /sasprep/fit/fit_1/run/azi/d2d/w6;
%let RacineBloctel = particuliers/bloctel/fichiers; /* you use a slash later when you call the macro variable */
%let REP_BLOCTEL_RETOUR = /sasprep/prep/cft/w6/BLOCTEL/ENTRANT;

data _null_;
infile "cp &amp;amp;rep_bloctel_retour./* &amp;amp;RacineRun./&amp;amp;RacineBloctel./archive 2&amp;gt;&amp;amp;1" pipe;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The INFILE PIPE method shown here retrieves all responses from the external command to the SAS log. The 2&amp;gt;&amp;amp;1 at the end of the command reroutes stderr to stdout, so the pipe catches "normal" and error messages.&lt;/P&gt;
&lt;P&gt;If you still get issues, post the complete log from the above code.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 06:40:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-copy-from-a-unix-directory-to-another/m-p/815998#M322054</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-06-01T06:40:17Z</dc:date>
    </item>
  </channel>
</rss>

