<?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 what is the point of specifying ouput statement after subsetting statement if result is the same? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/what-is-the-point-of-specifying-ouput-statement-after-subsetting/m-p/847118#M334919</link>
    <description>&lt;P&gt;the two codes below produced the same result. So what is the point of the output; statement?&lt;/P&gt;
&lt;PRE&gt;data cars2 (drop=color);
	set spg.cars;
	if color='G';
	output;
run;
proc print data=cars2;run;&lt;/PRE&gt;
&lt;PRE&gt;data cars2 (drop=color);
	set spg.cars;
	if color='G';
run;
proc print data=cars2;run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_0-1669833236457.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77878i67D750BD0849250C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_0-1669833236457.png" alt="Nietzsche_0-1669833236457.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2022 18:34:10 GMT</pubDate>
    <dc:creator>Nietzsche</dc:creator>
    <dc:date>2022-11-30T18:34:10Z</dc:date>
    <item>
      <title>what is the point of specifying ouput statement after subsetting statement if result is the same?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/what-is-the-point-of-specifying-ouput-statement-after-subsetting/m-p/847118#M334919</link>
      <description>&lt;P&gt;the two codes below produced the same result. So what is the point of the output; statement?&lt;/P&gt;
&lt;PRE&gt;data cars2 (drop=color);
	set spg.cars;
	if color='G';
	output;
run;
proc print data=cars2;run;&lt;/PRE&gt;
&lt;PRE&gt;data cars2 (drop=color);
	set spg.cars;
	if color='G';
run;
proc print data=cars2;run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_0-1669833236457.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77878i67D750BD0849250C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_0-1669833236457.png" alt="Nietzsche_0-1669833236457.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 18:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/what-is-the-point-of-specifying-ouput-statement-after-subsetting/m-p/847118#M334919</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2022-11-30T18:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: what is the point of specifying ouput statement after subsetting statement if result is the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/what-is-the-point-of-specifying-ouput-statement-after-subsetting/m-p/847119#M334920</link>
      <description>&lt;P&gt;In this example, the outcome is the same. But there are numerous examples where an explicit Output Statement is quite handy. In your example, there is an implicit Output Statement (And Return Statement) at the bottom of the Data Step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consult the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1lltvbis7ye1an1eryo4leh2mck.htm" target="_self"&gt;Output Statement Doc&lt;/A&gt; for information and examples.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 18:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/what-is-the-point-of-specifying-ouput-statement-after-subsetting/m-p/847119#M334920</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-11-30T18:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: what is the point of specifying ouput statement after subsetting statement if result is the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/what-is-the-point-of-specifying-ouput-statement-after-subsetting/m-p/847121#M334921</link>
      <description>&lt;P&gt;In the simple example you have, OUTPUT really has no impact, but in other cases OUTPUT could be useful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars2 (drop=color);
	set spg.cars;
	if color='G';
        /* perform some complicated calculation that takes 10 steps and generates a value in variable RESULT */
	if result&amp;lt;0 then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 18:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/what-is-the-point-of-specifying-ouput-statement-after-subsetting/m-p/847121#M334921</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-30T18:48:34Z</dc:date>
    </item>
  </channel>
</rss>

