<?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: Macro output multiple data to multiple tabs into one excel. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-output-multiple-data-to-multiple-tabs-into-one-excel/m-p/167168#M32203</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Reeza,&lt;/P&gt;&lt;P&gt;I actually read your old post on the same issue: &lt;A __default_attr="193778" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am running SAS EG on server, &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt; I don't have install privilege either. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The '&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt; DBMS=ExcelCS&lt;/SPAN&gt;' doesn't seem to work. &lt;/P&gt;&lt;P&gt;Putting macros in ods tagsets isn't promising either, after copying pasting the code and several modification tries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may has something to do with my connection to the server, cause I got error msg like 'ERROR: Server Name is invalid or missing.'. I will surely try them on my local SAS later today.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Feb 2015 15:31:10 GMT</pubDate>
    <dc:creator>jiangmi</dc:creator>
    <dc:date>2015-02-13T15:31:10Z</dc:date>
    <item>
      <title>Macro output multiple data to multiple tabs into one excel.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-output-multiple-data-to-multiple-tabs-into-one-excel/m-p/167164#M32199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, All,&lt;/P&gt;&lt;P&gt;Is there a way that we can append results from macro runs to multiple tabs in one single excel file?&lt;/P&gt;&lt;P&gt;Take an example like below, each time the macro run, new output will replace the old. However, I want both results to be present in one excel file (picture show).&lt;/P&gt;&lt;P&gt;I also tried ODS TAGSETS, it doesn't seem to work either.&amp;nbsp; Please offer opinions. Thanks. Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have1;&lt;/P&gt;&lt;P&gt;sex='M';run;&lt;/P&gt;&lt;P&gt;data have2;&lt;/P&gt;&lt;P&gt;sex='F';run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro test (data, var);&lt;/P&gt;&lt;P&gt;proc export&lt;/P&gt;&lt;P&gt;data=&amp;amp;data (where=(sex="&amp;amp;var"))&lt;/P&gt;&lt;P&gt;outfile="/SASData/SASUSER/Range/why2.xlsx"&lt;/P&gt;&lt;P&gt;dbms=xlsx replace;&lt;/P&gt;&lt;P&gt;sheet="&amp;amp;var";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%test(have1, M)&lt;/P&gt;&lt;P&gt;%test(have2, F)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="bothinexcel.JPG" class="jive-image" src="https://communities.sas.com/legacyfs/online/9147_bothinexcel.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2015 22:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-output-multiple-data-to-multiple-tabs-into-one-excel/m-p/167164#M32199</guid>
      <dc:creator>jiangmi</dc:creator>
      <dc:date>2015-02-12T22:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Macro output multiple data to multiple tabs into one excel.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-output-multiple-data-to-multiple-tabs-into-one-excel/m-p/167165#M32200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try DBMS=ExcelCS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do it using XLSX if you have SAS 9.4 or applied a hot fix to SAS 9.3 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2015 23:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-output-multiple-data-to-multiple-tabs-into-one-excel/m-p/167165#M32200</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-12T23:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Macro output multiple data to multiple tabs into one excel.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-output-multiple-data-to-multiple-tabs-into-one-excel/m-p/167166#M32201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What kind of hotfix?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 02:46:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-output-multiple-data-to-multiple-tabs-into-one-excel/m-p/167166#M32201</guid>
      <dc:creator>jiangmi</dc:creator>
      <dc:date>2015-02-13T02:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macro output multiple data to multiple tabs into one excel.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-output-multiple-data-to-multiple-tabs-into-one-excel/m-p/167167#M32202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://ftp.sas.com/techsup/download/hotfix/HF2/G31.html" title="http://ftp.sas.com/techsup/download/hotfix/HF2/G31.html"&gt;Hot Fixes for SAS/ACCESS Interface to PC Files 9.3_M1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #000000; background-color: #ffffff; font-family: arial, arial;"&gt;The XLSX engine is enhanced to write multiple sheets per Microsoft Excel file in the first maintenance release of SAS® 9.3 (TS1M1)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, arial; background-color: #ffffff;"&gt;I don't know if you have 9.3TS1M2 if this would be fixed or not. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, arial; background-color: #ffffff;"&gt;At any rate, tagsets.excelxp will definitely work, but it's a different structure for the code. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, arial; background-color: #ffffff;"&gt;Untested, but it would be something like the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;data have1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sex='M';run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;data have2;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sex='F';run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;%macro test (data, var);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;options tagsets.excelxp(sheet_name="&amp;amp;var");&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;proc print data=&amp;amp;data &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;(where=(sex="&amp;amp;var"))&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;%mend test;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ods tagsets.excelxp file="C:\temp\out.xlsx" style=journal;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;%test(have1, M)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;%test(have2, F)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ods tagsets.excelxp close;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 05:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-output-multiple-data-to-multiple-tabs-into-one-excel/m-p/167167#M32202</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-13T05:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Macro output multiple data to multiple tabs into one excel.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-output-multiple-data-to-multiple-tabs-into-one-excel/m-p/167168#M32203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Reeza,&lt;/P&gt;&lt;P&gt;I actually read your old post on the same issue: &lt;A __default_attr="193778" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am running SAS EG on server, &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt; I don't have install privilege either. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The '&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt; DBMS=ExcelCS&lt;/SPAN&gt;' doesn't seem to work. &lt;/P&gt;&lt;P&gt;Putting macros in ods tagsets isn't promising either, after copying pasting the code and several modification tries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may has something to do with my connection to the server, cause I got error msg like 'ERROR: Server Name is invalid or missing.'. I will surely try them on my local SAS later today.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 15:31:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-output-multiple-data-to-multiple-tabs-into-one-excel/m-p/167168#M32203</guid>
      <dc:creator>jiangmi</dc:creator>
      <dc:date>2015-02-13T15:31:10Z</dc:date>
    </item>
  </channel>
</rss>

