<?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: if/then do output in Programming 1 and 2</title>
    <link>https://communities.sas.com/t5/Programming-1-and-2/if-then-do-output/m-p/764039#M830</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/354036"&gt;@jaliu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;in the first line why do we list the three tables first?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To declare these as output tables. This is the required syntax within a Data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;if we don't list them, why doesn't the output statement create the tables as they do when we use output statement elsewhere?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I believe you're referring to the OUTPUT statement in PROCS which have an OUT= option that allows you to then specify the data set name. The OUTPUT statement functions different in a data step (compared to a proc) where you are not required to specify the output data set name, but can specify the output data set name. If you have multiple data sets specified in the DATA statement but do not specify the data set in the OUTPUT statement, it is written to &lt;STRONG&gt;all&lt;/STRONG&gt; datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;why is there no equal sign after output?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Because that is the data step syntax for a data set OUTPUT statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you may be confusing some of the OUT= options in other procs with the OUTPUT statement. Even with PROC MEANS which has an OUTPUT statement, there's an OUT= to specify the data set name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;lastly why do we need ; before output sometimes but other times don't?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;Not sure this is true or correct. Please expand further with examples.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;how can i can make sense of these things?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Read the documentation very, very closely.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You seem to be confusing options and statements at the moment for starters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post code as text in the future, and please put a descriptive subject line. This post has nothing to do with IF/THEN DO statements so if someone now searches for help with an IF/THEN question this comes up and is not helpful.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/354036"&gt;@jaliu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jaliu_0-1629924427082.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63023i2387ECA836B6B5E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jaliu_0-1629924427082.png" alt="jaliu_0-1629924427082.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;in the first line why do we list the three tables first?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;if we don't list them, why doesn't the output statement create the tables as they do when we use output statement elsewhere?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;why is there no equal sign after output?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;lastly why do we need ; before output sometimes but other times don't?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;how can i can make sense of these things?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Aug 2021 21:09:23 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-08-25T21:09:23Z</dc:date>
    <item>
      <title>if/then do output</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/if-then-do-output/m-p/764024#M829</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jaliu_0-1629924427082.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63023i2387ECA836B6B5E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jaliu_0-1629924427082.png" alt="jaliu_0-1629924427082.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;in the first line why do we list the three tables first?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;if we don't list them, why doesn't the output statement create the tables as they do when we use output statement elsewhere?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;why is there no equal sign after output?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;lastly why do we need ; before output sometimes but other times don't?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;how can i can make sense of these things?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 20:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/if-then-do-output/m-p/764024#M829</guid>
      <dc:creator>jaliu</dc:creator>
      <dc:date>2021-08-25T20:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: if/then do output</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/if-then-do-output/m-p/764039#M830</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/354036"&gt;@jaliu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;in the first line why do we list the three tables first?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To declare these as output tables. This is the required syntax within a Data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;if we don't list them, why doesn't the output statement create the tables as they do when we use output statement elsewhere?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I believe you're referring to the OUTPUT statement in PROCS which have an OUT= option that allows you to then specify the data set name. The OUTPUT statement functions different in a data step (compared to a proc) where you are not required to specify the output data set name, but can specify the output data set name. If you have multiple data sets specified in the DATA statement but do not specify the data set in the OUTPUT statement, it is written to &lt;STRONG&gt;all&lt;/STRONG&gt; datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;why is there no equal sign after output?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Because that is the data step syntax for a data set OUTPUT statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you may be confusing some of the OUT= options in other procs with the OUTPUT statement. Even with PROC MEANS which has an OUTPUT statement, there's an OUT= to specify the data set name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;lastly why do we need ; before output sometimes but other times don't?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;Not sure this is true or correct. Please expand further with examples.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;how can i can make sense of these things?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Read the documentation very, very closely.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You seem to be confusing options and statements at the moment for starters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post code as text in the future, and please put a descriptive subject line. This post has nothing to do with IF/THEN DO statements so if someone now searches for help with an IF/THEN question this comes up and is not helpful.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/354036"&gt;@jaliu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jaliu_0-1629924427082.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63023i2387ECA836B6B5E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jaliu_0-1629924427082.png" alt="jaliu_0-1629924427082.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;in the first line why do we list the three tables first?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;if we don't list them, why doesn't the output statement create the tables as they do when we use output statement elsewhere?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;why is there no equal sign after output?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;lastly why do we need ; before output sometimes but other times don't?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;how can i can make sense of these things?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 21:09:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/if-then-do-output/m-p/764039#M830</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-25T21:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: if/then do output</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/if-then-do-output/m-p/764082#M835</link>
      <description>&lt;P&gt;You can also distribute output observations to multiple datasets without explicit output statements.&amp;nbsp; You could use "where" flters in the data statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data indian   (where=(oceancode='I'))
     atlantic (where=(oceancode='A'))
     pacific  (where=(oceancode not in ('A','I')) ;
  set og1.strom_summary;
  length ocean $8;
  keep basic season name maxwindmph ocean;
  basin=upcase(basin);
  oceancode=substr(basin,2,1);
  if ocenacode="I' then ocean="Indian";
  else if oceancode="A" then ocean="Atlantic";
  else ocean="Pacific";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Aug 2021 00:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/if-then-do-output/m-p/764082#M835</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-08-26T00:49:47Z</dc:date>
    </item>
  </channel>
</rss>

