<?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 splitting data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/splitting-data/m-p/335349#M75886</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a big file and want to split it into different smaller file with the same record and fewer column each file.&lt;/P&gt;
&lt;P&gt;In the below sample, I will split have into b and c file.&lt;/P&gt;
&lt;P&gt;My issue is that I want to delete the columns already used so the have file becomes smaller after each round.&lt;/P&gt;
&lt;P&gt;Of course I can do something like " data have; set have; drop..." but it takes time to run that data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input x b1 b11 b2 b22;
datalines;
1 5 10 20 1
2 5 1 2 2
3 50 100 200 3
;run;

%macro split_data (rr=);
data data_&amp;amp;rr ; set have;
keep x b&amp;amp;rr.: ;run; 
%mend;
%split_data (rr=1);
%split_data (rr=2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 23 Feb 2017 17:01:45 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2017-02-23T17:01:45Z</dc:date>
    <item>
      <title>splitting data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/splitting-data/m-p/335349#M75886</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a big file and want to split it into different smaller file with the same record and fewer column each file.&lt;/P&gt;
&lt;P&gt;In the below sample, I will split have into b and c file.&lt;/P&gt;
&lt;P&gt;My issue is that I want to delete the columns already used so the have file becomes smaller after each round.&lt;/P&gt;
&lt;P&gt;Of course I can do something like " data have; set have; drop..." but it takes time to run that data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input x b1 b11 b2 b22;
datalines;
1 5 10 20 1
2 5 1 2 2
3 50 100 200 3
;run;

%macro split_data (rr=);
data data_&amp;amp;rr ; set have;
keep x b&amp;amp;rr.: ;run; 
%mend;
%split_data (rr=1);
%split_data (rr=2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Feb 2017 17:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/splitting-data/m-p/335349#M75886</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-02-23T17:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: splitting data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/splitting-data/m-p/335354#M75888</link>
      <description>&lt;P&gt;If you're splitting your table via columns you may as well set up a fact/dim table structure using a star or snowflake schema.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If thats an option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What makes your file 'big'?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 17:16:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/splitting-data/m-p/335354#M75888</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-23T17:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: splitting data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/splitting-data/m-p/335360#M75890</link>
      <description>&lt;P&gt;Why not do it all in one data step? e.g.,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
input x b1 b11 b2 b22;
datalines;
1 5 10 20 1
2 5 1 2 2
3 50 100 200 3
;
run;

data data1 (keep=x b1--b11)
         data2 (keep=x b2--b22);
  set have;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 17:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/splitting-data/m-p/335360#M75890</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-02-23T17:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: splitting data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/splitting-data/m-p/335443#M75921</link>
      <description>Perfect, Art297.&lt;BR /&gt;The combine all in 1 data step save a lot of time.&lt;BR /&gt;HHC</description>
      <pubDate>Thu, 23 Feb 2017 22:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/splitting-data/m-p/335443#M75921</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-02-23T22:51:10Z</dc:date>
    </item>
  </channel>
</rss>

