<?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: Base SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS/m-p/365034#M86654</link>
    <description>&lt;P&gt;Another case where short examples of your input data sets and what the result should look like as indicated in the "how to post a good question" reminders.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interleaving&amp;nbsp; (like shuffling a deck of cards&amp;nbsp;) and appending (placing one half of the&amp;nbsp;deck on top&amp;nbsp;of the other) are two different concepts. Since your code isn't executeable&amp;nbsp;it really&amp;nbsp;isn't clear which&amp;nbsp;you are attempting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note if you use a data step loop such as do i= 1 to n. You can conditionally terminate the loop early with the LEAVE instruction such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do i = 1 to 1000;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;some code&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if varx &amp;gt; 25 then leave;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;would terminate when the value of varx is&amp;nbsp;greater than 25. Which would in context only make sense if the other code is modifying varx in some manner.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2017 15:18:22 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-06-07T15:18:22Z</dc:date>
    <item>
      <title>Base SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS/m-p/364866#M86588</link>
      <description>&lt;P&gt;I have a dataset(data_1) and I want to append all the data from this dataset to a new dataset(data_2) one by one and also delete the data which I have appended into data_2 from data_1 until the data_1 becomes empty,so it's basically a kind of Cut&amp;amp;Paste&lt;/P&gt;&lt;P&gt;so I am using the following approach&lt;/P&gt;&lt;P&gt;do i=1 to 1000000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;append base=data_2 data=data_1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;..............&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; end;&lt;/P&gt;&lt;P&gt;But i want to stop this loop as soon as soon as the data_1 becomes empty just to avoid unnecessary &amp;nbsp;looping,&lt;/P&gt;&lt;P&gt;so please suggest me a solution to insert just before the end statement&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am providing the pseudocode&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do i=1 to 1000000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;append base=data_2 data=data_1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;..............&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if(data_1 = empty)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;then stop;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is just what i am trying to do, it's not the exact code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so please suggest me some solution to write the code using the Leave command.&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 09:36:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS/m-p/364866#M86588</guid>
      <dc:creator>Himanshu007</dc:creator>
      <dc:date>2017-06-07T09:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS/m-p/364869#M86590</link>
      <description>&lt;P&gt;Please stop posting topics with the title "Base SAS". &amp;nbsp;The topic title is supposed to be a summary of the question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With regards to your question, why are you appending a dataset row by row in a loop? &amp;nbsp;To append data to an existing dataset you would use the procedure designed for the task:&lt;/P&gt;
&lt;PRE&gt;proc append base=base data=new_data;
run;&lt;/PRE&gt;
&lt;P&gt;Alternatively you can set data underneath and create a new dataset:&lt;/P&gt;
&lt;PRE&gt;data want;
  set old_data new_data;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Jun 2017 09:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS/m-p/364869#M86590</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-06-07T09:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS/m-p/364906#M86605</link>
      <description>&lt;P&gt;Well, one can do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
x1 = 0;
do i = 1 to 10000;
  x1 = x1 + 2;
end;
drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or one can do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
x1 = 10000 * 2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I clearly prefer method #2, and you should do the same and run one single append as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; already suggested.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 11:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS/m-p/364906#M86605</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-07T11:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS/m-p/365034#M86654</link>
      <description>&lt;P&gt;Another case where short examples of your input data sets and what the result should look like as indicated in the "how to post a good question" reminders.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interleaving&amp;nbsp; (like shuffling a deck of cards&amp;nbsp;) and appending (placing one half of the&amp;nbsp;deck on top&amp;nbsp;of the other) are two different concepts. Since your code isn't executeable&amp;nbsp;it really&amp;nbsp;isn't clear which&amp;nbsp;you are attempting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note if you use a data step loop such as do i= 1 to n. You can conditionally terminate the loop early with the LEAVE instruction such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do i = 1 to 1000;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;some code&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if varx &amp;gt; 25 then leave;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;would terminate when the value of varx is&amp;nbsp;greater than 25. Which would in context only make sense if the other code is modifying varx in some manner.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS/m-p/365034#M86654</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-07T15:18:22Z</dc:date>
    </item>
  </channel>
</rss>

