<?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: Exporting file in Excel file into a single sheet from multiple SAS datsets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476836#M122735</link>
    <description>&lt;P&gt;yes I did proc append . it is happening correctly. I just wanted to know without proc append in proc export do you have any option so that we can append all the records in one single sheet.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jul 2018 14:42:38 GMT</pubDate>
    <dc:creator>Spintu</dc:creator>
    <dc:date>2018-07-10T14:42:38Z</dc:date>
    <item>
      <title>Exporting file in Excel file into a single sheet from multiple SAS datsets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476752#M122700</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please someone suggest me , while doing the below steps. In out put I am getting only last datasets records.&lt;/P&gt;&lt;P&gt;I want pull all the table information into a single sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the tables having same column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro export(dst=);&lt;BR /&gt;&amp;nbsp;proc export&amp;nbsp; data=&amp;amp;dst.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;outfile="&amp;amp;rptpath./XYZ.xls"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;Label dbms=xls Replace;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;sheet="sheet1";&lt;BR /&gt;&amp;nbsp;run;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;%export(dst=ABC);&lt;BR /&gt;%export(dst=ABD);&lt;BR /&gt;%export(dst=ASD);&lt;BR /&gt;%export(dst=ASF);&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 11:57:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476752#M122700</guid>
      <dc:creator>Spintu</dc:creator>
      <dc:date>2018-07-10T11:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting file in Excel file into a single sheet from multiple SAS datsets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476756#M122703</link>
      <description>&lt;P&gt;You might find the following &lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/2174-2018.pdf" target="_self"&gt;article&lt;/A&gt;&amp;nbsp;helpful.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 12:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476756#M122703</guid>
      <dc:creator>lorenzo_hg</dc:creator>
      <dc:date>2018-07-10T12:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting file in Excel file into a single sheet from multiple SAS datsets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476758#M122704</link>
      <description>&lt;P&gt;You want to export multiple datasets into the same excel sheet correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where do you want the datasets to be? On top of each other or?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 12:24:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476758#M122704</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-10T12:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting file in Excel file into a single sheet from multiple SAS datsets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476761#M122707</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you considered appending the data sets before writing the appended one&amp;nbsp;out, e.g. &lt;FONT face="courier new,courier"&gt;proc append&lt;/FONT&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 12:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476761#M122707</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2018-07-10T12:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting file in Excel file into a single sheet from multiple SAS datsets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476794#M122724</link>
      <description>&lt;P&gt;When every you call the macro %export() with a dataset then entire xls file will be replaced with that data. As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22588"&gt;@Amir&lt;/a&gt;&amp;nbsp;mentioned put them in single dataset and then export into single file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data ABC ABD ASD ASF;&lt;BR /&gt;set sashelp.class;&lt;BR /&gt;if _n_&amp;lt;5 then output ABC;&lt;BR /&gt;else if _n_&amp;lt;10 then output ABD;&lt;BR /&gt;else if _n_&amp;lt;15 then output ASD;&lt;BR /&gt;else output ASF;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Options symbolgen mprint mlogic;&lt;BR /&gt;%MACRO APPEND(ds=);&lt;BR /&gt;%DO I=2 %TO %sysfunc(countw(&amp;amp;ds));&lt;BR /&gt;%let BASE_DS=%SCAN(%QUOTE(&amp;amp;DS),1);&lt;BR /&gt;%let Data_ds=%SCAN(%QUOTE(&amp;amp;DS),&amp;amp;i);&lt;BR /&gt;PROC APPEND BASE=&amp;amp;Base_ds DATA=&amp;amp;Data_ds;&lt;BR /&gt;RUN;&lt;BR /&gt;%END;&lt;BR /&gt;proc export &lt;BR /&gt; data=ABC &lt;BR /&gt; outfile='/usr/apps/sasdata/CAO/CAOSec/local_access/CAO_DropBox/Kiran/test_append.xlsx'&lt;BR /&gt; dbms=xlsx replace;&lt;BR /&gt;sheet='sheet1';&lt;BR /&gt;run;&lt;BR /&gt;%MEND APPEND;&lt;BR /&gt;%APPEND(ds=ABC ABD ASD ASF);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 13:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476794#M122724</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-07-10T13:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting file in Excel file into a single sheet from multiple SAS datsets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476833#M122733</link>
      <description>&lt;P&gt;yes I did proc append . it is happening correctly. I just wanted to know without proc append in proc export do you have any option so that we can append all the records in one single sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 14:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476833#M122733</guid>
      <dc:creator>Spintu</dc:creator>
      <dc:date>2018-07-10T14:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting file in Excel file into a single sheet from multiple SAS datsets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476834#M122734</link>
      <description>&lt;P&gt;Yes, all the datasets are from work library.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 14:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476834#M122734</guid>
      <dc:creator>Spintu</dc:creator>
      <dc:date>2018-07-10T14:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting file in Excel file into a single sheet from multiple SAS datsets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476836#M122735</link>
      <description>&lt;P&gt;yes I did proc append . it is happening correctly. I just wanted to know without proc append in proc export do you have any option so that we can append all the records in one single sheet.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 14:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476836#M122735</guid>
      <dc:creator>Spintu</dc:creator>
      <dc:date>2018-07-10T14:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting file in Excel file into a single sheet from multiple SAS datsets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476837#M122736</link>
      <description>&lt;P&gt;You could possibly figure out how to write to a specific starting CELL in the Excel file.&amp;nbsp; But it is probably not worth it.&lt;/P&gt;
&lt;P&gt;Note that you can use the XLSX engine to write directly to an Excel file . So you could just combine the datasets as you write them by using a simple data step that sets multiple datasets together.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname out xlsx 'myexcel.xlsx';
data out.want ;
  set a b c d e ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 14:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-file-in-Excel-file-into-a-single-sheet-from-multiple/m-p/476837#M122736</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-10T14:50:33Z</dc:date>
    </item>
  </channel>
</rss>

