<?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 Populating a template excel file with another excel file in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Populating-a-template-excel-file-with-another-excel-file/m-p/57462#M16016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does your site have SAS Access/PC files?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Feb 2012 17:28:16 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-02-17T17:28:16Z</dc:date>
    <item>
      <title>Populating a template excel file with another excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Populating-a-template-excel-file-with-another-excel-file/m-p/57461#M16015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering if this is possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically if I have 2 excel files : File1.xls and File2.xls&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I use SAS to say: Take all rows/columns from file1.xls and put them (starting at a specific cell) in File2.xls?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next part of my question is...can I do the same for specific cell ranges? So Cells A1:A10 from File1.xls to Cells N1:N10 in File2.xls&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please provide sample codes if possible &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 17:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Populating-a-template-excel-file-with-another-excel-file/m-p/57461#M16015</guid>
      <dc:creator>vomer</dc:creator>
      <dc:date>2012-02-17T17:15:25Z</dc:date>
    </item>
    <item>
      <title>Populating a template excel file with another excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Populating-a-template-excel-file-with-another-excel-file/m-p/57462#M16016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does your site have SAS Access/PC files?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 17:28:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Populating-a-template-excel-file-with-another-excel-file/m-p/57462#M16016</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-17T17:28:16Z</dc:date>
    </item>
    <item>
      <title>Populating a template excel file with another excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Populating-a-template-excel-file-with-another-excel-file/m-p/57463#M16017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes they do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 18:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Populating-a-template-excel-file-with-another-excel-file/m-p/57463#M16017</guid>
      <dc:creator>vomer</dc:creator>
      <dc:date>2012-02-17T18:22:46Z</dc:date>
    </item>
    <item>
      <title>Populating a template excel file with another excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Populating-a-template-excel-file-with-another-excel-file/m-p/57464#M16018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure why I asked about SAS Access, as the export procedure doesn't allow one to use a range statement.&lt;/P&gt;&lt;P&gt;Thus, I used DDE to export the file.&amp;nbsp; If you're not familiar with DDE, you can find numerous examples on the web.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took a shortcut and simply opened the desired output file manually.&amp;nbsp; You would probably want to do all of that programmatically .. which is definitely possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below, I use proc import to import the desired range, then output it to a different range on another spreadsheet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.have;&lt;/P&gt;&lt;P&gt; DATAFILE= "C:\art\abc.xls" &lt;/P&gt;&lt;P&gt; DBMS=excel REPLACE;&lt;/P&gt;&lt;P&gt; range='feb2012$A1:A27'n;&lt;/P&gt;&lt;P&gt; GETNAMES=no;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename dataout dde "excel|[cba.xls]Sheet1!r1c14:r27c14" notab;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;file dataout;&lt;/P&gt;&lt;P&gt;put f1 $20.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 19:31:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Populating-a-template-excel-file-with-another-excel-file/m-p/57464#M16018</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-17T19:31:17Z</dc:date>
    </item>
  </channel>
</rss>

