<?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: Best way to put data from sas into pre-formatted Excel xslx file automatically in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Best-way-to-put-data-from-sas-into-pre-formatted-Excel-xslx-file/m-p/553527#M153944</link>
    <description>&lt;P&gt;One approach that works well is to use the SAS Add-in to MS Office. You set a data sheet that is simply a copy of a SAS dataset. When you want to update it you just use the SAS tab on the Excel menu and do a Data Refresh.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The next step is you run an Excel macro (I'm assuming competence in this area, something I lack) which reads the data sheet and then populates your pre-formatted sheet exactly how you want it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The advantage of this method is it is simple, the disadvantage is it requires manual steps.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2019 06:00:11 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2019-04-24T06:00:11Z</dc:date>
    <item>
      <title>Best way to put data from sas into pre-formatted Excel xslx file automatically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Best-way-to-put-data-from-sas-into-pre-formatted-Excel-xslx-file/m-p/553506#M153935</link>
      <description />
      <pubDate>Wed, 24 Apr 2019 02:56:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Best-way-to-put-data-from-sas-into-pre-formatted-Excel-xslx-file/m-p/553506#M153935</guid>
      <dc:creator>sam1231</dc:creator>
      <dc:date>2019-04-24T02:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to put data from sas into pre-formatted Excel xslx file automatically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Best-way-to-put-data-from-sas-into-pre-formatted-Excel-xslx-file/m-p/553517#M153941</link>
      <description>&lt;P&gt;This post easily earns the price for the tersest question!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using a &lt;FONT face="courier new,courier"&gt;libname&lt;/FONT&gt; statement with the &lt;FONT face="courier new,courier"&gt;xlsx&lt;/FONT&gt; engine allows you to push data into an existing file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%* Create sample excel file;
proc export data=SASHELP.CLASS(obs=2) dbms=xlsx outfile="%sysfunc(pathname(WORK))\class.xlsx" replace;run;

%* Print contents;
libname XL xlsx "%sysfunc(pathname(WORK))\class.xlsx";
proc print data=XL.CLASS; run;

%* Update and print contents;
data XL.CLASS; set SASHELP.CLASS(obs=3); run;
proc print data=XL.CLASS; run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set XL.CLASS" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Name&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Sex&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Age&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Height&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Weight&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;Alfred&lt;/TD&gt;
&lt;TD class="l data"&gt;M&lt;/TD&gt;
&lt;TD class="r data"&gt;14&lt;/TD&gt;
&lt;TD class="r data"&gt;69&lt;/TD&gt;
&lt;TD class="r data"&gt;112.5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;Alice&lt;/TD&gt;
&lt;TD class="l data"&gt;F&lt;/TD&gt;
&lt;TD class="r data"&gt;13&lt;/TD&gt;
&lt;TD class="r data"&gt;56.5&lt;/TD&gt;
&lt;TD class="r data"&gt;84&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="branch"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR size="3" /&gt;&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set XL.CLASS" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Name&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Sex&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Age&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Height&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Weight&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;Alfred&lt;/TD&gt;
&lt;TD class="l data"&gt;M&lt;/TD&gt;
&lt;TD class="r data"&gt;14&lt;/TD&gt;
&lt;TD class="r data"&gt;69&lt;/TD&gt;
&lt;TD class="r data"&gt;112.5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;Alice&lt;/TD&gt;
&lt;TD class="l data"&gt;F&lt;/TD&gt;
&lt;TD class="r data"&gt;13&lt;/TD&gt;
&lt;TD class="r data"&gt;56.5&lt;/TD&gt;
&lt;TD class="r data"&gt;84&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="l data"&gt;Barbara&lt;/TD&gt;
&lt;TD class="l data"&gt;F&lt;/TD&gt;
&lt;TD class="r data"&gt;13&lt;/TD&gt;
&lt;TD class="r data"&gt;65.3&lt;/TD&gt;
&lt;TD class="r data"&gt;98&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 03:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Best-way-to-put-data-from-sas-into-pre-formatted-Excel-xslx-file/m-p/553517#M153941</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-04-24T03:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to put data from sas into pre-formatted Excel xslx file automatically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Best-way-to-put-data-from-sas-into-pre-formatted-Excel-xslx-file/m-p/553527#M153944</link>
      <description>&lt;P&gt;One approach that works well is to use the SAS Add-in to MS Office. You set a data sheet that is simply a copy of a SAS dataset. When you want to update it you just use the SAS tab on the Excel menu and do a Data Refresh.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The next step is you run an Excel macro (I'm assuming competence in this area, something I lack) which reads the data sheet and then populates your pre-formatted sheet exactly how you want it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The advantage of this method is it is simple, the disadvantage is it requires manual steps.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 06:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Best-way-to-put-data-from-sas-into-pre-formatted-Excel-xslx-file/m-p/553527#M153944</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-04-24T06:00:11Z</dc:date>
    </item>
  </channel>
</rss>

