<?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: Splitting a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Splitting-a-dataset/m-p/312282#M67707</link>
    <description>&lt;P&gt;To be honest, unless there is a clear reason (maybe file transmittal can only old a certain amount) then its not a good idea to split data. &amp;nbsp;It just means you end up with lots of segments to program on.&lt;/P&gt;
&lt;P&gt;Its is trvial however to do:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set your_data nobs=n;
  do i=1 to (n/500);
    call execute('data temp;  set your_data point='||put(i-1*500)||' obs=500; run;');
    call execute('proc export data=temp outfile="&amp;lt;path to file&amp;gt;\File'||strip(put(i,best.))||'.xls"; run;');
  end;
run;&lt;/PRE&gt;
&lt;P&gt;Do note, not tested, but something like that should work.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Nov 2016 11:07:50 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-11-17T11:07:50Z</dc:date>
    <item>
      <title>Splitting a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-a-dataset/m-p/312189#M67670</link>
      <description>&lt;P&gt;Hello, I found a real good macro here once that split a huge dataset (500K) records into equal portions of 30,000 and it was so simple, but now I can't find it.&amp;nbsp; I would like to split a file only 34K records&amp;nbsp;by account number into equal records of 500 records. I know I know its about 64 datasets, however that is all the other end can handle.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have anything to attach as I am looking for the example&amp;nbsp; I had previously.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 02:55:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-a-dataset/m-p/312189#M67670</guid>
      <dc:creator>adammom</dc:creator>
      <dc:date>2016-11-17T02:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-a-dataset/m-p/312206#M67679</link>
      <description>&lt;P&gt;Splitting files is relatively trivial if you have clear rules.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say account number and 500 records? Does that mean each file is for a single account and maximum 500 records? Or can a file of 500 records have multiple accounts?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the final output format, Excel, csv, sas7bdat data set?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Split it by grouping variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/" target="_blank"&gt;http://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By amount&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/split-file-into-multiple-files/td-p/56457" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/split-file-into-multiple-files/td-p/56457&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your final output is a text file use file options, see example 4&amp;amp;5 here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lestmtsref/68024/HTML/default/viewer.htm#n15o12lpyoe4gfn1y1vcp6xs6966.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/lestmtsref/68024/HTML/default/viewer.htm#n15o12lpyoe4gfn1y1vcp6xs6966.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 05:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-a-dataset/m-p/312206#M67679</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-17T05:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-a-dataset/m-p/312282#M67707</link>
      <description>&lt;P&gt;To be honest, unless there is a clear reason (maybe file transmittal can only old a certain amount) then its not a good idea to split data. &amp;nbsp;It just means you end up with lots of segments to program on.&lt;/P&gt;
&lt;P&gt;Its is trvial however to do:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set your_data nobs=n;
  do i=1 to (n/500);
    call execute('data temp;  set your_data point='||put(i-1*500)||' obs=500; run;');
    call execute('proc export data=temp outfile="&amp;lt;path to file&amp;gt;\File'||strip(put(i,best.))||'.xls"; run;');
  end;
run;&lt;/PRE&gt;
&lt;P&gt;Do note, not tested, but something like that should work.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 11:07:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-a-dataset/m-p/312282#M67707</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-17T11:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-a-dataset/m-p/312317#M67721</link>
      <description>Thank you! Will give it a try. I sent a file of 32k and was told I had to split it in increments of 500.&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Nov 2016 13:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-a-dataset/m-p/312317#M67721</guid>
      <dc:creator>adammom</dc:creator>
      <dc:date>2016-11-17T13:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-a-dataset/m-p/312326#M67723</link>
      <description>&lt;P&gt;If your doing a data transfer then best to use an appropriate format, CSV, XML, etc.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 13:24:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-a-dataset/m-p/312326#M67723</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-17T13:24:13Z</dc:date>
    </item>
  </channel>
</rss>

