<?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: OUTPUT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/OUTPUT/m-p/843927#M333635</link>
    <description>&lt;P&gt;It's always astonishing to see the crazy ways people come up with to make code less understandable, and less maintainable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data live_account;
merge live_account(in=a) purge(in=b) plan(in=c);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Don't do this. If, during development, the data step has a semantic mistake, dataset live_account will be destroyed, forcing you to recreate it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if a and ~b;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It is preferable to use the mnemonic NOT in place of the tilde character; some characters may not be available on all platforms, or text processing software tends to replace them with UTF equivalents. A keyword is immune to that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if card_type in ("PL" "TU") then do;
if plan_num=60000 then output;
end;
else output;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A little Boolean transformation simplifies this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if card_type not in ("PL" "TU") or plan_num = 60000 then output;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Reading the documentation (&lt;STRONG&gt;Maxim1!&lt;/STRONG&gt;) will quickly tell you what the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1lltvbis7ye1an1eryo4leh2mck.htm" target="_blank" rel="noopener"&gt;OUTPUT Statement&lt;/A&gt;&amp;nbsp;does.&lt;/P&gt;</description>
    <pubDate>Sat, 12 Nov 2022 12:52:57 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-11-12T12:52:57Z</dc:date>
    <item>
      <title>OUTPUT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/OUTPUT/m-p/843912#M333631</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data live_account;
merge live_account(in=a) purge(in=b) plan(in=c);
if a and ~b;
by account_no;
;

if card_type in ("PL" "TU") then do;
if plan_num=60000 then output;
end;
else output;
run;
&lt;/PRE&gt;
&lt;P&gt;is output here a dataset name or it just means only&lt;/P&gt;
&lt;P&gt;if card_type in ("PL "TU") then if plan_num =60000 then output to dataset live_account?&lt;/P&gt;
&lt;P&gt;otherwise output everything that is not card_type in ("PL "TU") into dataset live_account?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2022 10:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/OUTPUT/m-p/843912#M333631</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-11-12T10:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: OUTPUT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/OUTPUT/m-p/843917#M333632</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data live_account;
merge live_account(in=a) purge(in=b) plan(in=c);
if a and ~b;
by account_no;
;

if card_type in ("PL" "TU") then do;
if plan_num=60000 then output;
end;
else output;
run;
&lt;/PRE&gt;
&lt;P&gt;is output here a dataset name or it just means only&lt;/P&gt;
&lt;P&gt;if card_type in ("PL "TU") then if plan_num =60000 then output to dataset live_account?&lt;/P&gt;
&lt;P&gt;otherwise output everything that is not card_type in ("PL "TU") into dataset live_account?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Whenever you have actual SAS code, you can run the code and see the results. SAS will answer your questions, and do it more quickly than asking questions here. And unlike my answers, which are not correct 100% of the time, you know you will get the correct answer from SAS 100% of the time (maybe even more than 100% of the time!)&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2022 11:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/OUTPUT/m-p/843917#M333632</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-12T11:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: OUTPUT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/OUTPUT/m-p/843927#M333635</link>
      <description>&lt;P&gt;It's always astonishing to see the crazy ways people come up with to make code less understandable, and less maintainable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data live_account;
merge live_account(in=a) purge(in=b) plan(in=c);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Don't do this. If, during development, the data step has a semantic mistake, dataset live_account will be destroyed, forcing you to recreate it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if a and ~b;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It is preferable to use the mnemonic NOT in place of the tilde character; some characters may not be available on all platforms, or text processing software tends to replace them with UTF equivalents. A keyword is immune to that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if card_type in ("PL" "TU") then do;
if plan_num=60000 then output;
end;
else output;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A little Boolean transformation simplifies this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if card_type not in ("PL" "TU") or plan_num = 60000 then output;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Reading the documentation (&lt;STRONG&gt;Maxim1!&lt;/STRONG&gt;) will quickly tell you what the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1lltvbis7ye1an1eryo4leh2mck.htm" target="_blank" rel="noopener"&gt;OUTPUT Statement&lt;/A&gt;&amp;nbsp;does.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2022 12:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/OUTPUT/m-p/843927#M333635</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-12T12:52:57Z</dc:date>
    </item>
  </channel>
</rss>

