<?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: PROC EXPORT conditionning number of rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-EXPORT-conditionning-number-of-rows/m-p/313737#M68218</link>
    <description>&lt;P&gt;You want functionality like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#p011imau3tm4jen1us2a45cyenz9.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#p011imau3tm4jen1us2a45cyenz9.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in this case of 0, it prints an error message. You can change the proc print to an export and the message as required.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Nov 2016 10:50:19 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-11-23T10:50:19Z</dc:date>
    <item>
      <title>PROC EXPORT conditionning number of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-EXPORT-conditionning-number-of-rows/m-p/313730#M68215</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you know, Excel is limited by its number of rows. According to this, I have a user requirement telling that: "The maximum number of records is 1.048,576 rows"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to export a table in an Excel sheet with famous PROC EXPORT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to perform this requirement by exporting the table in the Excel sheet if the number of rows is less, or else displaying a error in the Excel sheet telling something like "Too much data: the number of records is N", and replace N by the number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But honestly, I am not an expert in SAS, even more a beginner than expert so I really don't know if there is a way to do it.&lt;/P&gt;&lt;P&gt;Can you help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:30:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-EXPORT-conditionning-number-of-rows/m-p/313730#M68215</guid>
      <dc:creator>fabdu92</dc:creator>
      <dc:date>2016-11-23T10:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: PROC EXPORT conditionning number of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-EXPORT-conditionning-number-of-rows/m-p/313736#M68217</link>
      <description>&lt;P&gt;Well, first off is the usual text. &amp;nbsp;Why are you using Excel - unstrcutured, uncontrolled, very bad format for data transport - as a data transport format? &amp;nbsp;Not only will you hit certain restrictions on size with it, Excel has lots of "features" which really make it a bad choice. &amp;nbsp;Also its far more difficult to import/qc. &amp;nbsp;I really would use any other available format - CSV, XML, dataset, delimited, json etc. &amp;nbsp;All are far better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for your code you could do (although if your not familiar with SAS, this is a bit more advanced):&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set sashelp.vtable (where=(libname="L1" and memname="D1"));
  do i=1 to (nobs / 1000);
    call execute('data tmp; set l1.d1; if '||strip(put(i*1000,best.))||' &amp;lt;=_n_ &amp;lt; '||strip(put((i+1)*1000),best.))||' then output; run;');
    call execute('proc export outfile="c:\outputfile'||strip(put(i,best.))||'.xlsx" data=tmp; run;'); 
  end;
run;&lt;/PRE&gt;
&lt;P&gt;What this does is generate a datastep and proc export for each block of observations of 1000 obs. &amp;nbsp;Note change L1 and D1 to your lib and dataset, and change 1000 to number of obs.&lt;/P&gt;
&lt;P&gt;However I still really recommned not using Excel.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:47:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-EXPORT-conditionning-number-of-rows/m-p/313736#M68217</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-23T10:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: PROC EXPORT conditionning number of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-EXPORT-conditionning-number-of-rows/m-p/313737#M68218</link>
      <description>&lt;P&gt;You want functionality like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#p011imau3tm4jen1us2a45cyenz9.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#p011imau3tm4jen1us2a45cyenz9.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in this case of 0, it prints an error message. You can change the proc print to an export and the message as required.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-EXPORT-conditionning-number-of-rows/m-p/313737#M68218</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-23T10:50:19Z</dc:date>
    </item>
  </channel>
</rss>

