<?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: Export to Excel from unix SAS code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/325008#M271382</link>
    <description>&lt;P&gt;The XLSX engine makes things much simpler. It's fully available since &lt;SPAN&gt;SAS 9.3 TS1M1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://support.sas.com/kb/51/580.html" target="_blank"&gt;http://support.sas.com/kb/51/580.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There are also options with other engines as documented here (i.e. page 8):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/acpcref/63181/PDF/default/acpcref.pdf" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/acpcref/63181/PDF/default/acpcref.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jan 2017 11:22:39 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2017-01-16T11:22:39Z</dc:date>
    <item>
      <title>Export to Excel from unix SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/324973#M271376</link>
      <description>&lt;P&gt;Greetings Everyone!!,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am afraid I know already know the answer to this one but is there any possible way to export to Excel from unix SAS code(not PC SAS).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I want a piece of code which I can run on Unix SAS server using nohup and then automate it thorugh SAS BI server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Vikas&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 07:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/324973#M271376</guid>
      <dc:creator>Tmacfan</dc:creator>
      <dc:date>2017-01-16T07:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel from unix SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/324976#M271377</link>
      <description>&lt;P&gt;Depends on what you want as output (raw data or formatted report). Beginning with SAS 9.4, you can write xlxs-formatted files directly, using proc export, ODS, or libname.&lt;/P&gt;
&lt;P&gt;Prior to that, the best method was to use a text-based format for data transfer, or ods tagsets.excelxp for formatted reporting in a XML file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So:&lt;/P&gt;
&lt;P&gt;- what SAS version do you have?&lt;/P&gt;
&lt;P&gt;- what is the desired output?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 07:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/324976#M271377</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-16T07:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel from unix SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/324991#M271378</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for taking out the time to address my SAS problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically what I am trying is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) copy&amp;nbsp;the one excel with pivot to SAS temp using below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;length filein 8 fileid 8;&lt;BR /&gt;filein = fopen('in','I',1,'B');&lt;BR /&gt;fileid = fopen('out','O',1,'B');&lt;BR /&gt;rec = '20'x;&lt;BR /&gt;do while(fread(filein)=0);&lt;BR /&gt;rc = fget(filein,rec,1);&lt;BR /&gt;rc = fput(fileid, rec);&lt;BR /&gt;rc =fwrite(fileid);&lt;BR /&gt;end;&lt;BR /&gt;rc = fclose(filein);&lt;BR /&gt;rc = fclose(fileid);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Now I want to updated another raw data sheet in the above excel with pivot so that&lt;/P&gt;&lt;P&gt;when user opens the excel pivot gets auto refreshed with new raw data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this I was wondering if I can export sas dataset to this excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Vikas&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 09:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/324991#M271378</guid>
      <dc:creator>Tmacfan</dc:creator>
      <dc:date>2017-01-16T09:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel from unix SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/324992#M271379</link>
      <description>&lt;P&gt;The problem you face is common, your trying to update another applications file without the tools. &amp;nbsp;Reverse the thinking of it. &amp;nbsp;If you absolutely have to use Excel (which I would always push back on), then use the tools available in Office - VBA. &amp;nbsp;You have a complex non-standard file format, and to that you need to adde some exported data - forget about what tech - so as a soloution, look at a way of loading data into the Excel file directly from the Excel file. &amp;nbsp;It is very simple, dump out your data to CSV. &amp;nbsp;Then in your Excel file has a few simple lines of VBA code which opens that CSV file into a new sheet, then updates all the graphs and pivots, there are many examplew on the web of loading CSV files in Excel VBA, and note you don't need to store the VBA in the same file, you could have any empty Excel file with your VBA code which loads the template XLSX and the CSV, puts them together and then saves them. &amp;nbsp;Avoids all the copy paste, and trying to drive one app from another.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 09:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/324992#M271379</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-16T09:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel from unix SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/324993#M271380</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122564"&gt;@Tmacfan&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this I was wondering if I can export sas dataset to this excel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Replacing a single sheet within an Excel xlsx workbook would be done by assigning the Excel as a library with &lt;FONT face="courier new,courier"&gt;libname xlsx&lt;/FONT&gt; and then writing a dataset to it.&lt;/P&gt;
&lt;P&gt;Requires SAS 9.4.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 09:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/324993#M271380</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-16T09:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel from unix SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/325001#M271381</link>
      <description>&lt;P&gt;Thanks Kurt, so there is no way to do the same in SAS 9.3?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 10:41:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/325001#M271381</guid>
      <dc:creator>Tmacfan</dc:creator>
      <dc:date>2017-01-16T10:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel from unix SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/325008#M271382</link>
      <description>&lt;P&gt;The XLSX engine makes things much simpler. It's fully available since &lt;SPAN&gt;SAS 9.3 TS1M1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://support.sas.com/kb/51/580.html" target="_blank"&gt;http://support.sas.com/kb/51/580.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There are also options with other engines as documented here (i.e. page 8):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/acpcref/63181/PDF/default/acpcref.pdf" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/acpcref/63181/PDF/default/acpcref.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 11:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/325008#M271382</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-01-16T11:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel from unix SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/325046#M271383</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You indicate that you have the SAS BI Server. Do you also have the SAS Add-in for Microsoft Office. If you do have and use the SAS Add-in for Microsoft Office, then you can load SAS data into a worksheet via a SAS task or a SAS Stored Process and have the sheet automatically be updated with the SAS data when the workbook/sheet is opened.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I do not understand why you are not using the capabilities build into the BI server, stored process and the SAS Add-in for Microsoft Office. One of the reasons for getting the BI components and the SAS Add-in for Microsoft Office is to be able to use SAS data without familiar Office applications and to make the capability to "refresh" on open just another option to check. Here's a paper that describes the basic SAS Add-in functionality &lt;A href="http://support.sas.com/resources/papers/proceedings14/1403-2014.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings14/1403-2014.pdf&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; And, if you do not want to use the built-in capabilities, you can always write VBA, as described in this paper &lt;A href="http://support.sas.com/resources/papers/proceedings11/012-2011.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings11/012-2011.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 15:12:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/325046#M271383</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-01-16T15:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel from unix SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/325202#M271384</link>
      <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for taking out the time and answering my queries &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do have SAS addin capability but for this particlualr task I need to update raw data into a excel sheet with pivot already existing&lt;/P&gt;&lt;P&gt;and then somehow mail that to end-user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will look into VBA if that can help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help o t he same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Vikas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 09:20:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-from-unix-SAS-code/m-p/325202#M271384</guid>
      <dc:creator>Tmacfan</dc:creator>
      <dc:date>2017-01-17T09:20:53Z</dc:date>
    </item>
  </channel>
</rss>

