<?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 Move Zip File from One Location to Another in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Zip-File-from-One-Location-to-Another/m-p/693286#M211358</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming you have at least SAS 9.4M2, as an alternative, you can do it in pure data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* paths */
%let outpath = %sysfunc(pathname(work))/a/;
%let archive = %sysfunc(pathname(work))/b/;
%let filein = abc.zip;

/* make file */
filename abc ZIP "&amp;amp;outpath.&amp;amp;filein" member="abc.txt";
data _null_;
  file abc;
  do i = 1 to 1e5;
    put i;
  end;
run;


/* move */
filename in "&amp;amp;outpath.&amp;amp;filein" recfm=f lrecl=1;
filename out "&amp;amp;archive.&amp;amp;filein" recfm=f lrecl=1;

data _null_;
  rc = fcopy("in", "out");
  put rc = ;
  if rc = 0 then rc = fdelete("in");
  put rc = ;
run;

filename in;
filename out;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Wed, 21 Oct 2020 19:24:27 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2020-10-21T19:24:27Z</dc:date>
    <item>
      <title>How to Move Zip File from One Location to Another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Zip-File-from-One-Location-to-Another/m-p/693273#M211354</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to use the following %sysexec statement to move a zip file from one location to another:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;%sysExec move "&amp;amp;outpath.&amp;amp;filein" "&amp;amp;archive";&lt;UL&gt;&lt;LI&gt;&amp;amp;outpath = the location of the zip file I am attempting to move.&lt;/LI&gt;&lt;LI&gt;&amp;amp;filein = the name of the zip file that I am trying to move (i.e. myzipfile.zip).&lt;/LI&gt;&lt;LI&gt;&amp;amp;archive = the location I would like to move the zip file to.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it does not appear to work. I do not receive an error, but nothing happens. Both folders are on the same server.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 18:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Zip-File-from-One-Location-to-Another/m-p/693273#M211354</guid>
      <dc:creator>cbourne090</dc:creator>
      <dc:date>2020-10-21T18:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to Move Zip File from One Location to Another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Zip-File-from-One-Location-to-Another/m-p/693275#M211356</link>
      <description>&lt;P&gt;Run your command with a pipe, so you can fetch the system's responses:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename move pipe "move '&amp;amp;outpath.&amp;amp;filein' '&amp;amp;archive' 2&amp;gt;&amp;amp;1";

data _null_;
infile move;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Oct 2020 18:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Zip-File-from-One-Location-to-Another/m-p/693275#M211356</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-21T18:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to Move Zip File from One Location to Another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Zip-File-from-One-Location-to-Another/m-p/693286#M211358</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming you have at least SAS 9.4M2, as an alternative, you can do it in pure data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* paths */
%let outpath = %sysfunc(pathname(work))/a/;
%let archive = %sysfunc(pathname(work))/b/;
%let filein = abc.zip;

/* make file */
filename abc ZIP "&amp;amp;outpath.&amp;amp;filein" member="abc.txt";
data _null_;
  file abc;
  do i = 1 to 1e5;
    put i;
  end;
run;


/* move */
filename in "&amp;amp;outpath.&amp;amp;filein" recfm=f lrecl=1;
filename out "&amp;amp;archive.&amp;amp;filein" recfm=f lrecl=1;

data _null_;
  rc = fcopy("in", "out");
  put rc = ;
  if rc = 0 then rc = fdelete("in");
  put rc = ;
run;

filename in;
filename out;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 19:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Zip-File-from-One-Location-to-Another/m-p/693286#M211358</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-10-21T19:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to Move Zip File from One Location to Another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Zip-File-from-One-Location-to-Another/m-p/693338#M211375</link>
      <description>&lt;P&gt;Yes, you should just use the FCOPY function.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 22:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Zip-File-from-One-Location-to-Another/m-p/693338#M211375</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-10-21T22:11:17Z</dc:date>
    </item>
  </channel>
</rss>

