<?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: Non-executable set statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239682#M44133</link>
    <description>&lt;P&gt;FreelanceReinhard, I checked the difference between compile phase and execution phase before posting this question. I know &amp;nbsp;intializing to missing values was the part of the execution phase. Since the set statment never executes, I thought it does not &amp;nbsp;initialize ; just compile the variable names only. So my take was even without stop statment it should contain only variable names &amp;nbsp;not missing observartions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi23/Begtutor/p50.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi23/Begtutor/p50.pdf&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2015 01:10:16 GMT</pubDate>
    <dc:creator>SAS_inquisitive</dc:creator>
    <dc:date>2015-12-17T01:10:16Z</dc:date>
    <item>
      <title>Non-executable set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239659#M44118</link>
      <description>&lt;P&gt;This chunk of code inherited by previous author.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data test;
	if 0 then
		set sashelp.class;
    stop;
run;&lt;/PRE&gt;&lt;P&gt;This code produces zero observation.&amp;nbsp;Without stop, there is one observation in the test data. &amp;nbsp;I thought non-executable set statment should not produce any observation even without stop statement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 23:00:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239659#M44118</guid>
      <dc:creator>SAS_inquisitive</dc:creator>
      <dc:date>2015-12-16T23:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Non-executable set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239680#M44131</link>
      <description>&lt;P&gt;This is just the standard DATA step behavior. To cite the &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#p18vk5t9cwort1n18g7zg2no6tr4.htm" target="_blank"&gt;documentation&lt;/A&gt;: "&lt;SPAN&gt;When SAS executes the last statement in the DATA step, all values in the PDV ... are written as a single observation to the data set ..." However, the &lt;A href="http://support.sas.com/documentation/cdl/en/syntaxidx/68719/HTML/default/index.htm#/documentation/cdl//en/lestmtsref/68024/HTML/default/p02jy612cym9oxn10i19cbewlrdf.htm" target="_blank"&gt;STOP statement&lt;/A&gt;&amp;nbsp;"causes SAS to stop processing the current DATA step immediately", i.e. the PDV is &lt;EM&gt;not&lt;/EM&gt; written to the output dataset.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please note that the PDV contains only missing values in that one observation you obtain without STOP, not any value from SASHELP.CLASS. The IF condition 0 being false, no values are retrieved&amp;nbsp;from SASHELP.CLASS.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 00:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239680#M44131</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2015-12-17T00:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Non-executable set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239682#M44133</link>
      <description>&lt;P&gt;FreelanceReinhard, I checked the difference between compile phase and execution phase before posting this question. I know &amp;nbsp;intializing to missing values was the part of the execution phase. Since the set statment never executes, I thought it does not &amp;nbsp;initialize ; just compile the variable names only. So my take was even without stop statment it should contain only variable names &amp;nbsp;not missing observartions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi23/Begtutor/p50.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi23/Begtutor/p50.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 01:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239682#M44133</guid>
      <dc:creator>SAS_inquisitive</dc:creator>
      <dc:date>2015-12-17T01:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: Non-executable set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239692#M44138</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;During COMPILE time, the DATA step constructs the program data vector (PDV), a logical construct that you can think of as a single row (thus vector) that will hold records as they are processed.&amp;nbsp; When a SET statement executes, it reads a record into the PDV.&amp;nbsp; When an assignemnt statement executes, it changes a value in the PDV.&amp;nbsp; When an OUTPUT statement executes, it outputs the values in the PDV to a dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the PDV is constructed, it has null values.&amp;nbsp; If you OUTPUT a PDV with null values, you output a record with null values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are a few examples that may be helpful:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;140  data OneObs;
141    if 0 then set sashelp.class;
142    *implied OUTPUT;
143  run;

NOTE: DATA STEP stopped due to looping.
NOTE: The data set WORK.ONEOBS has 1 observations and 5 variables.

144
145  data ZeroObs;
146    if 0 then set sashelp.class;
147    stop;
148    *implied OUTPUT;
149  run;

NOTE: The data set WORK.ZEROOBS has 0 observations and 5 variables.

150
151  data OneObs;
152    if 0 then set sashelp.class;
153    output;
154    stop;
155  run;

NOTE: The data set WORK.ONEOBS has 1 observations and 5 variables.

156
157  data TwoObs;
158    if 0 then set sashelp.class;
159    output;
160    output;
161    stop;
162  run;

NOTE: The data set WORK.TWOOBS has 2 observations and 5 variables.&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Dec 2015 02:22:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239692#M44138</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-12-17T02:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Non-executable set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239699#M44140</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test1; run;
/* or */
data test2; stop; run;
/* or */
data test3 test4;
output test3;
stop;
output test4;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and read about &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#n0fjj14wij8q3jn1qpsq5770xhs2.htm" target="_self"&gt;What causes a data step to stop executing&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 03:05:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239699#M44140</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-12-17T03:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Non-executable set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239701#M44142</link>
      <description>&lt;P&gt;Thanks Quentin.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 03:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239701#M44142</guid>
      <dc:creator>SAS_inquisitive</dc:creator>
      <dc:date>2015-12-17T03:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Non-executable set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239702#M44143</link>
      <description>&lt;P&gt;Thanks, PG. This helps a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 03:41:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239702#M44143</guid>
      <dc:creator>SAS_inquisitive</dc:creator>
      <dc:date>2015-12-17T03:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Non-executable set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239707#M44145</link>
      <description>Thanks, FreelanceReinhard.</description>
      <pubDate>Thu, 17 Dec 2015 04:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Non-executable-set-statement/m-p/239707#M44145</guid>
      <dc:creator>SAS_inquisitive</dc:creator>
      <dc:date>2015-12-17T04:44:49Z</dc:date>
    </item>
  </channel>
</rss>

