<?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: Multiple set statements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190101#M35867</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes from data D.&amp;nbsp; Explain why that is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To better understand add a variable to each data set with a unique name.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Mar 2015 13:25:12 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2015-03-03T13:25:12Z</dc:date>
    <item>
      <title>Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190089#M35855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ran the code below in EG 7.1 to understand how multiple set statements works. But I could not understand why data step (whilst creating data set c) read only 2 observations from dataset a although it has 3 observations. See the log which is highlighted in red color.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also can I assume that we will get the output in final datastep which holds records with least number of observations in set statements? e.g. A table has 1 obs, B table has 2 obs, C table has 3 obs then D table (data d;set a;&lt;/P&gt;&lt;P&gt;set b;set c;run;) should produce 1 obs which is similar to A table. (?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data a;&lt;/P&gt;&lt;P&gt;b="a";output;&lt;/P&gt;&lt;P&gt;b="b";output;&lt;/P&gt;&lt;P&gt;b="f";output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data b;&lt;/P&gt;&lt;P&gt;b="c";output;&lt;/P&gt;&lt;P&gt;b="d";output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data d;&lt;/P&gt;&lt;P&gt;b="e";output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data c;&lt;/P&gt;&lt;P&gt;set b;&lt;/P&gt;&lt;P&gt;set a;&lt;/P&gt;&lt;P&gt;set d;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Log:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;23&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data a;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b="a";output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;25&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b="b";output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;26&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b="f";output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;27&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: Compression was disabled for data set WORK.A because compression overhead would increase the size of the data set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: The data set WORK.A has 3 observations and 1 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;28&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data b;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b="c";output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b="d";output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;33&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: Compression was disabled for data set WORK.B because compression overhead would increase the size of the data set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: The data set WORK.B has 2 observations and 1 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;34&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;35&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data d;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;36&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b="e";output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;37&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;38&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: Compression was disabled for data set WORK.D because compression overhead would increase the size of the data set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: The data set WORK.D has 1 observations and 1 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;39&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;40&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data c;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;41&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set b;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;42&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set a;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;43&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set d;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;44&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: Compression was disabled for data set WORK.C because compression overhead would increase the size of the data set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: There were 2 observations read from the data set WORK.B.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: red; background: white;"&gt;There were 2 observations read from the data set WORK.A&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: There were 1 observations read from the data set WORK.D.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;NOTE: The data set WORK.C has 1 observations and 1 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 11:40:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190089#M35855</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-03-03T11:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190090#M35856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps you should first consider why WORK.C has only 1 observation.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 11:55:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190090#M35856</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-03-03T11:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190091#M35857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's also one off my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;EM&gt;Also can I assume that we will get the output in final datastep which holds records with least number of observations in set statements? e.g. A table has 1 obs, B table has 2 obs, C table has 3 obs then D table (data d;set a;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;EM&gt;set b;set c;run;) should produce 1 obs which is similar to A table. (?)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 12:07:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190091#M35857</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-03-03T12:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190092#M35858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Test.&amp;nbsp; Consider you first example with 1 obs output.&amp;nbsp; Which data set did the value of B come from.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your example is somewhat confounded by the fact that the variable(s) are the same in all.&amp;nbsp; The values are being overwritten before anything is output.&amp;nbsp; If you could run the data step debugger you would have good way to study exactly what is happening but you must have DMS SAS no EG/Batch.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 12:46:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190092#M35858</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-03-03T12:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190093#M35859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A data step exits &lt;STRONG&gt;immediately&lt;/STRONG&gt; if it executes a set statement, but there are no more observations in the data set.&lt;/P&gt;&lt;P&gt;In the second data step iteration (_N_=2) SAS reads table b, than table a, and then tries to read table d, which has no more rows. -&amp;gt;&amp;nbsp; exit (stop; ) , no implicit output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 12:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190093#M35859</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2015-03-03T12:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190094#M35860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dataset c returns the value for b as e. It is coming from the dataset d.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 13:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190094#M35860</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-03-03T13:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190095#M35861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By the way, this is the usual way, how a data step terminates. Run this code:&lt;/P&gt;&lt;P&gt;data class2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; putlog 'BEFORE ' _all_;&amp;nbsp;&amp;nbsp; /*_N_=20 is printed here*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.class;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*exit here, when _N_=20 - no more obs*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; putlog 'AFTER' _all_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 13:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190095#M35861</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2015-03-03T13:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190096#M35862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you saying that output will be from the first set statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May I request you to explain it with small example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 13:03:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190096#M35862</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-03-03T13:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190097#M35863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. At the first data step iteration:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;1. SAS reads table b,&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 13px; background-color: #ffffff;"&gt;b="c" - but no output to table c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;2. SAS reads table a,&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 13px; background-color: #ffffff;"&gt;b="a" - but no output to table c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;1. SAS reads table b,&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 13px; background-color: #ffffff;"&gt;b="e" - now there is an output to table c&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 13:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190097#M35863</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2015-03-03T13:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190098#M35864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sorry, still I couldn't understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 13:06:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190098#M35864</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-03-03T13:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190099#M35865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I augmented your code, so you can see in the log, what is happening.&lt;/P&gt;&lt;P&gt;I also put an &lt;STRONG&gt;output&lt;/STRONG&gt; statement at the end of the data step (this changes nothing in this case, just instead of implicit output, we use explicit output)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data c;&lt;/P&gt;&lt;P&gt;putlog '1:' _all_;&lt;/P&gt;&lt;P&gt;set b;&lt;/P&gt;&lt;P&gt;putlog '2:' _all_;&lt;/P&gt;&lt;P&gt;set a;&lt;/P&gt;&lt;P&gt;putlog '3:' _all_;&lt;/P&gt;&lt;P&gt;set d;&lt;/P&gt;&lt;P&gt;putlog '4:' _all_;&lt;/P&gt;&lt;P&gt;putlog 'OUTPUT will be here';&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 13:09:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190099#M35865</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2015-03-03T13:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190100#M35866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the table which holds minimum number of observations from the list of set statements will be returned as output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;e.g. A table has 1 obs, B table has 2 obs, C table has 3 obs then D table (data d;set a;&lt;/EM&gt;&lt;EM style="font-weight: inherit; font-family: inherit; font-size: 10pt; line-height: 1.5em;"&gt;set b;set c;run;) should produce 1 obs which is similar to A table. (?)&lt;/EM&gt;&lt;/P&gt;&lt;P class="jive-thread-reply-btn" style="margin: 26px 0 -10px; font-size: 0.9em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;DIV class="jive-thread-reply-btn-correct" style="font-weight: inherit; font-style: inherit; font-size: 11.6999998092651px; font-family: inherit;"&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/message/259501" style="margin: 0 20px 0 0; padding: 2px 14px 4px 28px; font-weight: bold; font-style: inherit; font-size: 11.6999998092651px; font-family: inherit; color: #0e66ba; background-color: #f3f3f3;"&gt;Re: Multiple set statements&lt;/A&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 13:16:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190100#M35866</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-03-03T13:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190101#M35867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes from data D.&amp;nbsp; Explain why that is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To better understand add a variable to each data set with a unique name.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 13:25:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190101#M35867</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-03-03T13:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190102#M35868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;Babloo wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;So the table which holds minimum number of observations from the list of set statements will be returned as output.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-family: inherit; font-size: 11.6999998092651px; font-style: inherit; line-height: 1.5em;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NO, that is not the correct way to understand what is happening.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 13:26:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190102#M35868</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-03-03T13:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple set statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190103#M35869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No. The input table with the least number of observations determines after how many iterations the data step stops (and how many observations are written).&lt;/P&gt;&lt;P&gt;The output is determined by the last statement that filled the output data vector before the implicit write at the end of the data step iteration is reached.&lt;/P&gt;&lt;P&gt;So, in your first example, your variable b is ALWAYS filled with values from dataset d (because set d; is the last statement that alters the value of b prior to the write). Your output table will NEVER have values of tables a or b.&lt;/P&gt;&lt;P&gt;In your second example (&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;e.g. A table has 1 obs, B table has 2 obs, C table has 3 obs then D table (data d;set a;&lt;/EM&gt;&lt;EM style="font-weight: inherit; font-family: inherit; font-size: 10pt;"&gt;set b;set c;run;) should produce 1 obs which is similar to A table. (?))&lt;/EM&gt;, the values always come from table c, but table a determines the number of iterations (1).&lt;EM style="font-weight: inherit; font-family: inherit; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 13:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-set-statements/m-p/190103#M35869</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-03-03T13:46:24Z</dc:date>
    </item>
  </channel>
</rss>

