<?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 Exporting the data to xlsx in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Exporting-the-data-to-xlsx/m-p/103896#M21698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Exporting the data :&lt;/P&gt;&lt;P&gt;As per the req i will create some dataset 10 to 1 crore and i wnat to export it to excel as xlsx is having a limit of&lt;BR /&gt;10,50,000(Approx 10 lac 50 thousand) and now i am doing manually and doing first obs and last obs and splitting the dataset to 10 lac and exporting&lt;BR /&gt;it how can i do it automatically and it should make the count and export to xls if the count is 65 lacs it should go to 7 excels of 10 lacs each&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Dec 2012 09:33:30 GMT</pubDate>
    <dc:creator>My_SAS</dc:creator>
    <dc:date>2012-12-19T09:33:30Z</dc:date>
    <item>
      <title>Exporting the data to xlsx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-the-data-to-xlsx/m-p/103896#M21698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Exporting the data :&lt;/P&gt;&lt;P&gt;As per the req i will create some dataset 10 to 1 crore and i wnat to export it to excel as xlsx is having a limit of&lt;BR /&gt;10,50,000(Approx 10 lac 50 thousand) and now i am doing manually and doing first obs and last obs and splitting the dataset to 10 lac and exporting&lt;BR /&gt;it how can i do it automatically and it should make the count and export to xls if the count is 65 lacs it should go to 7 excels of 10 lacs each&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 09:33:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-the-data-to-xlsx/m-p/103896#M21698</guid>
      <dc:creator>My_SAS</dc:creator>
      <dc:date>2012-12-19T09:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting the data to xlsx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-the-data-to-xlsx/m-p/103897#M21699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this should work if I understand the problem correctly (10 lacs 50 thousand or 1 million 50 thousand rows [the actual limit in excel 2007 to 2010 I believe is &lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small; background-color: #ffffff;"&gt;1,048,576&lt;/SPAN&gt; rows]), and this is for separate workbooks instead of worksheets but it could do either with some adjustment:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options mprint mlogic symbolgen;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro split(name,path);&lt;/P&gt;&lt;P&gt;Data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dsid = open("&amp;amp;name");&lt;/P&gt;&lt;P&gt;&amp;nbsp; n = attrn(dsid,'nobs');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symput('n',n);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;n;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%do int = 1 %to &amp;amp;n %by 1000;&lt;/P&gt;&lt;P&gt;libname out excel "&amp;amp;path.\Out_&amp;amp;int..xlsx";&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; obs = &amp;amp;int + 1000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symput('obs',obs);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;obs;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data out.OUT&amp;amp;int;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set &amp;amp;name (firstobs=&amp;amp;int obs=&amp;amp;obs);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname out clear;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend split;&lt;/P&gt;&lt;P&gt;%split(temp,/*insert Path here*/);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 13:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-the-data-to-xlsx/m-p/103897#M21699</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2012-12-19T13:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting the data to xlsx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-the-data-to-xlsx/m-p/103898#M21700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For an efficient and true dynamic approach, I prefer Hash plus excel libname engine: The following example is to split class into 5 students per sheet, and end up with 4 sheets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname test "c:\temp\test.xlsx";&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; declare hash h(ordered:'a');&lt;/P&gt;&lt;P&gt;h.definekey('n');&lt;/P&gt;&lt;P&gt;&amp;nbsp; h.definedata('name','age','weight');&lt;/P&gt;&lt;P&gt;h.definedone();&lt;/P&gt;&lt;P&gt; do n=1 to 5 until (last); &lt;/P&gt;&lt;P&gt;&amp;nbsp; set sashelp.class end=last;&lt;/P&gt;&lt;P&gt;&amp;nbsp; h.add();&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt; h.output(dataset: cats('test.split',_n_));&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;libname test clear;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 14:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-the-data-to-xlsx/m-p/103898#M21700</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-12-19T14:21:09Z</dc:date>
    </item>
  </channel>
</rss>

