<?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 Add rows to data  set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-rows-to-data-set/m-p/754930#M238170</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Lets say that I have data set A and every day I create another data set called B and then I want to add the rows of B to A.&lt;/P&gt;
&lt;P&gt;I want to show 2 ways and ask which way is better ?&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/*Way1*/
Data A;
SET A B;
Run;
/*Way2*/
Data tempTbl;
SET A;
Run;
Proc delete data=A;Run;
Data A;
SET tempTbl B;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jul 2021 08:13:56 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2021-07-19T08:13:56Z</dc:date>
    <item>
      <title>Add rows to data  set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-rows-to-data-set/m-p/754930#M238170</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Lets say that I have data set A and every day I create another data set called B and then I want to add the rows of B to A.&lt;/P&gt;
&lt;P&gt;I want to show 2 ways and ask which way is better ?&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/*Way1*/
Data A;
SET A B;
Run;
/*Way2*/
Data tempTbl;
SET A;
Run;
Proc delete data=A;Run;
Data A;
SET tempTbl B;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 08:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-rows-to-data-set/m-p/754930#M238170</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-07-19T08:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add rows to data  set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-rows-to-data-set/m-p/754934#M238171</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Lets say that I have data set A and every day I create another data set called B and then I want to add the rows of B to A.&lt;/P&gt;
&lt;P&gt;I want to show 2 ways and ask which way is better ?&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/*Way1*/
Data A;
SET A B;
Run;
/*Way2*/
Data tempTbl;
SET A;
Run;
Proc delete data=A;Run;
Data A;
SET tempTbl B;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Proc append if the data sets have the same variables with the same lengths for character variables would be the better choice.&lt;/P&gt;
&lt;P&gt;Anything involving a data step reads each and every record. Which means your "Set A B"; runs slower and slower as A bets bigger.&lt;/P&gt;
&lt;P&gt;Proc Append works a bit differently and will typically run much faster for this type of activity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the variables are not the same then the first way would be more efficient in resources.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 08:27:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-rows-to-data-set/m-p/754934#M238171</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-19T08:27:39Z</dc:date>
    </item>
  </channel>
</rss>

