<?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 Excel Workbook and Save Under New Name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Copy-Excel-Workbook-and-Save-Under-New-Name/m-p/437254#M282229</link>
    <description>&lt;P&gt;Thank you.&amp;nbsp; I searched FCOPY, found this and it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename src "path-to-src" recfm=n;&lt;BR /&gt;filename dst "path-to-dst" recfm=n;&lt;BR /&gt;%let rc = %sysfunc(FCOPY(src,dst));&lt;BR /&gt;%put %sysfunc(SYSMSG());&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2018 18:12:33 GMT</pubDate>
    <dc:creator>eferencik</dc:creator>
    <dc:date>2018-02-14T18:12:33Z</dc:date>
    <item>
      <title>Copy Excel Workbook and Save Under New Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-Excel-Workbook-and-Save-Under-New-Name/m-p/437247#M282227</link>
      <description>&lt;P&gt;I am trying to use SAS to copy an existing excel workbook (a template)&amp;nbsp;and save it with a new name in a different folder (once updated with current data).&amp;nbsp; I have tried both steps below, but I cannot get&amp;nbsp;either to work.&amp;nbsp; It seems like it should be simple to do, the only difference between the 2 workbooks would be the file name and location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First tried:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;noxwait&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;rc= system(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;"copy S:\sas\Regular Reports\Vacancy Template.xlsx S:\oim\Regular Reports\Vacancy Report &amp;amp;sysdate..xlsx"&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; rc=;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I tried:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;noxwait&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;oldname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;"S:\sas\Regular Reports\Vacancy Template.xlsx"&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;newname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;"S:\oim\Regular Reports\Vacancy Report &amp;amp;sysdate..xlsx"&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;rc= system(quote(catx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;'copy'&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;,quote(trim(oldname)),quote(trim(newname)))));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; rc=;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 17:50:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-Excel-Workbook-and-Save-Under-New-Name/m-p/437247#M282227</guid>
      <dc:creator>eferencik</dc:creator>
      <dc:date>2018-02-14T17:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Excel Workbook and Save Under New Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-Excel-Workbook-and-Save-Under-New-Name/m-p/437250#M282228</link>
      <description>&lt;P&gt;If you're using SAS 9.4 try FCOPY instead.&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/99082"&gt;@eferencik&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to use SAS to copy an existing excel workbook (a template)&amp;nbsp;and save it with a new name in a different folder (once updated with current data).&amp;nbsp; I have tried both steps below, but I cannot get&amp;nbsp;either to work.&amp;nbsp; It seems like it should be simple to do, the only difference between the 2 workbooks would be the file name and location.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First tried:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;options&lt;/FONT&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;noxwait&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;rc= system(&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;"copy S:\sas\Regular Reports\Vacancy Template.xlsx S:\oim\Regular Reports\Vacancy Report &amp;amp;sysdate..xlsx"&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; rc=;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I tried:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;options&lt;/FONT&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;noxwait&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;oldname=&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;"S:\sas\Regular Reports\Vacancy Template.xlsx"&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;newname=&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;"S:\oim\Regular Reports\Vacancy Report &amp;amp;sysdate..xlsx"&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;rc= system(quote(catx(&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;'copy'&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;,quote(trim(oldname)),quote(trim(newname)))));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; rc=;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 18:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-Excel-Workbook-and-Save-Under-New-Name/m-p/437250#M282228</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-14T18:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Excel Workbook and Save Under New Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-Excel-Workbook-and-Save-Under-New-Name/m-p/437254#M282229</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp; I searched FCOPY, found this and it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename src "path-to-src" recfm=n;&lt;BR /&gt;filename dst "path-to-dst" recfm=n;&lt;BR /&gt;%let rc = %sysfunc(FCOPY(src,dst));&lt;BR /&gt;%put %sysfunc(SYSMSG());&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 18:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-Excel-Workbook-and-Save-Under-New-Name/m-p/437254#M282229</guid>
      <dc:creator>eferencik</dc:creator>
      <dc:date>2018-02-14T18:12:33Z</dc:date>
    </item>
  </channel>
</rss>

