<?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: How do i Export Multiple Sas Datasets into ms excel workbook wiht multiple sheets ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427209#M105339</link>
    <description>SAS 9.3&lt;BR /&gt;I tried to use libname method.&lt;BR /&gt;</description>
    <pubDate>Fri, 12 Jan 2018 15:12:35 GMT</pubDate>
    <dc:creator>vivekvardhan</dc:creator>
    <dc:date>2018-01-12T15:12:35Z</dc:date>
    <item>
      <title>How do i Export Multiple Sas Datasets into ms excel workbook wiht multiple sheets ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/426861#M105212</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have seen many posts and answers for my query, those are not helping me.&lt;/P&gt;&lt;P&gt;I'm using remote sas&amp;nbsp;server, sas&amp;nbsp;9.3 version. all datasets similar variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my query for an example :&lt;/P&gt;&lt;P&gt;&amp;nbsp; have&amp;nbsp;20 datasets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I want to export all datasets into one excel workbook with 20 sheets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I use dbms=xlsx below code last 20th dataset only comes in output.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;amp;&amp;amp;_table&amp;amp;i.&amp;nbsp; it contains all the 20 datasets names.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;cnt&amp;nbsp;has&amp;nbsp;value&amp;nbsp;of 20&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;here is my peice of code :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%do i = 1 %to &amp;amp;cnt;&lt;/P&gt;&lt;P&gt;PROC EXPORT DATA= &amp;amp;&amp;amp;_table&amp;amp;i.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;outfile= "pathwhereiwant to store.xlsx"&lt;BR /&gt;dbms=XLSX replace;&lt;BR /&gt;sheet="&amp;amp;&amp;amp;_table&amp;amp;i.";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;have used&amp;nbsp;libname&amp;nbsp; method&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;not working&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: The XLSX engine cannot be found.&lt;BR /&gt;ERROR: Error in the LIBNAME statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;expecting resolution&amp;nbsp;from experts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 13:21:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/426861#M105212</guid>
      <dc:creator>vivekvardhan</dc:creator>
      <dc:date>2018-01-11T13:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do i Export Multiple Sas Datasets into ms excel workbook wiht multiple sheets ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/426877#M105216</link>
      <description>&lt;P&gt;You are using SAS 9.3 so more recent functions like native XLSX does not work for you - a very good reason to update your software to something modern.&lt;/P&gt;
&lt;P&gt;You could do it in export - me I would prefer tagsets.excelxp as this gives you a lot more control and formatting over the output.&amp;nbsp; The surrounding code is the same in either event - note that &amp;lt;youlib&amp;gt; should be replaced with the library name you have your data in in uppercase.&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set sashelp.vtable (where=(libname="&amp;lt;yourlib&amp;gt;"));
  call execute(cats('proc export data=&amp;lt;yourlib&amp;gt;.',memname,' outfile="pathwhereiwant to store/file.xlsx"; sheet="',memname,'";run;'));
run;
&lt;/PRE&gt;
&lt;P&gt;That will create a proc export for each dataset in the given lib.&amp;nbsp; Ods is similar:&lt;/P&gt;
&lt;PRE&gt;ods tagsets.excelxp file="pathwhereiwant to store/file.xml";

data _null_;
  set sashelp.vtable (where=(libname="&amp;lt;yourlib&amp;gt;"));
  call execute(cats('ods tagsets.excelxp options(sheet_name="',memname,'"); proc report data=&amp;lt;yourlib&amp;gt;.',memname,' nowd; columns _all_; run;'));
run;

ods tagsets.excelxp close;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jan 2018 14:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/426877#M105216</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-11T14:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do i Export Multiple Sas Datasets into ms excel workbook wiht multiple sheets ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427115#M105304</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods&amp;nbsp; TAGSET ALSO NOT WORKING&lt;/P&gt;&lt;P&gt;/* into multiple datasets */&lt;BR /&gt;%do i = 2 %to &amp;amp;cnt;&lt;BR /&gt;%put count =&amp;amp;i. tablename= &amp;amp;&amp;amp;_table&amp;amp;i.;&lt;/P&gt;&lt;P&gt;data &amp;amp;&amp;amp;_table&amp;amp;i.;&lt;BR /&gt;set general data_(where=(Domain_Prefix = "&amp;amp;&amp;amp;_table&amp;amp;i." ));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;ods listing close;&lt;BR /&gt;ods tagsets.ExcelXP&lt;BR /&gt;path ='path where i want to save the excel sheet'&lt;BR /&gt;file='newsdtmspec.xls' OPTIONS (SHEET_NAME = "&amp;amp;&amp;amp;_table&amp;amp;i.");&lt;BR /&gt;proc report data= &amp;amp;&amp;amp;_table&amp;amp;i. nowd; columns _all_; run;&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;ods tagsets.ExcelXP close;&lt;BR /&gt;ods listing;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 07:34:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427115#M105304</guid>
      <dc:creator>vivekvardhan</dc:creator>
      <dc:date>2018-01-12T07:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do i Export Multiple Sas Datasets into ms excel workbook wiht multiple sheets ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427125#M105309</link>
      <description>&lt;P&gt;This: "&lt;SPAN&gt;ods&amp;nbsp; TAGSET ALSO NOT WORKING" - does not tell me anything, even if you SHOUT IT.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, please review the code I have provided you, it is not code to try to put into code you already have, it is code in and of itself, you do not need %do's or &amp;amp;&amp;amp; nonsense.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 08:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427125#M105309</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-12T08:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do i Export Multiple Sas Datasets into ms excel workbook wiht multiple sheets ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427190#M105334</link>
      <description>&lt;P&gt;What is your SAS version ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;libname x xls 'c:\xxxx.xls';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;libname x excel 'c:\xxxx.xls';&lt;/P&gt;
&lt;P&gt;proc copy in=work out=x;&lt;/P&gt;
&lt;P&gt;select a b c d;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 14:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427190#M105334</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-01-12T14:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do i Export Multiple Sas Datasets into ms excel workbook wiht multiple sheets ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427209#M105339</link>
      <description>SAS 9.3&lt;BR /&gt;I tried to use libname method.&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jan 2018 15:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427209#M105339</guid>
      <dc:creator>vivekvardhan</dc:creator>
      <dc:date>2018-01-12T15:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do i Export Multiple Sas Datasets into ms excel workbook wiht multiple sheets ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427437#M105411</link>
      <description>&lt;P&gt;So DBMS=XLSX is not available to you . Try DBMS=EXCEL or XLS .&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2018 10:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427437#M105411</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-01-13T10:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do i Export Multiple Sas Datasets into ms excel workbook wiht multiple sheets ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427447#M105416</link>
      <description>&lt;P&gt;You need to move the open/close outside of the %DO loop.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
ods tagsets.ExcelXP  file='full name of excel file' ;

%do i = 1 %to &amp;amp;cnt;
ods tagsets.ExcelXP OPTIONS (SHEET_NAME = "&amp;amp;&amp;amp;_table&amp;amp;i.");
proc report data=general_data nowd; 
  where Domain_Prefix = "&amp;amp;&amp;amp;_table&amp;amp;i." ;
  columns _all_; 
run;
%end;

ods tagsets.ExcelXP close;
ods listing ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Jan 2018 15:29:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427447#M105416</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-01-13T15:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do i Export Multiple Sas Datasets into ms excel workbook wiht multiple sheets ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427914#M105590</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks for your suggestion&lt;/P&gt;&lt;P&gt;the code is working fine but I'm getting popup while opening the excel book.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="exceliss.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17900i3C20A0F408531DE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="exceliss.PNG" alt="exceliss.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 04:51:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427914#M105590</guid>
      <dc:creator>vivekvardhan</dc:creator>
      <dc:date>2018-01-16T04:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do i Export Multiple Sas Datasets into ms excel workbook wiht multiple sheets ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427915#M105591</link>
      <description>The file is actually an XML file. If you try to trick Windows into thinking it is an XLS or XLSX file by naming the file with one of those extensions then Excel will normally warn you about that when you try to open it.&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Jan 2018 05:03:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/m-p/427915#M105591</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-01-16T05:03:35Z</dc:date>
    </item>
  </channel>
</rss>

