<?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/DELETE on SAS university edition not working? in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394987#M3414</link>
    <description>&lt;P&gt;I've ran the code the delete statement is definitely not processing through, and as you can see from the captured image the delete statement is not even recognized as a sas statement.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2017 05:37:18 GMT</pubDate>
    <dc:creator>syk</dc:creator>
    <dc:date>2017-09-12T05:37:18Z</dc:date>
    <item>
      <title>IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394984#M3412</link>
      <description>&lt;P&gt;What am I doing wrong? The statement is exactly the same format from the documentations I've read and the DELETE statement should be blue but it's greyed out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.GIF" style="width: 964px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15024i5D024DC65255CC03/image-dimensions/964x180?v=v2" width="964" height="180" role="button" title="Capture.GIF" alt="Capture.GIF" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 05:28:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394984#M3412</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-09-12T05:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394985#M3413</link>
      <description>&lt;P&gt;What is the question? Are you really talking about what COLOR the text is in the program editor?&lt;/P&gt;
&lt;P&gt;If you want to see if the code works, run it.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 05:33:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394985#M3413</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-09-12T05:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394987#M3414</link>
      <description>&lt;P&gt;I've ran the code the delete statement is definitely not processing through, and as you can see from the captured image the delete statement is not even recognized as a sas statement.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 05:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394987#M3414</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-09-12T05:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394989#M3415</link>
      <description>&lt;P&gt;By the way, your sum statement should be&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Total=sum(qtr1,qtr2,qtr3,qtr4);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Sep 2017 05:41:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394989#M3415</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2017-09-12T05:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394991#M3416</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/68169"&gt;@syk&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I've ran the code the delete statement is definitely not processing through, and as you can see from the captured image the delete statement is not even recognized as a sas statement.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You posted a photograph of an editor screen. The color coding that an editor does is just the editor's attempt to make your code look pretty. The editor does not actually contain the SAS parser/compiler or the SAS macro processor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to see whether the SAS code is correct you need to actually run the code. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to tell whether the DELETE statement ran we would need to see the LOG to see how many observations the data step read in and how many it wrote. We would also need to see the data since it could very well be that no obervations meet the IF condition so that the DELETE statement will never run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you had really typed something other than delete (perhaps de1ete) then you would have seen an error message in the SAS log that the statement was invalid.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 05:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394991#M3416</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-09-12T05:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394993#M3417</link>
      <description>&lt;P&gt;I've tried both conditions for the IF statement to produce 50 observations (the question wanted 50) but when I ran it again with the counter-logic it produced 88 observations (initial number of observations) so the delete statement did not work. And no I did not spell delete incorrectly. And as you can see for some reason when the delete statement is within the IF statement it's not picked up by the compiler, but by itself it is..&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.GIF" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15025i5D4EA7C582D3C2B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.GIF" alt="Capture.GIF" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 06:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394993#M3417</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-09-12T06:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394995#M3418</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/68169"&gt;@syk&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I've tried both conditions for the IF statement to produce 50 observations (the question wanted 50) but when I ran it again with the counter-logic it produced 88 observations (initial number of observations) so the delete statement did not work. And no I did not spell delete incorrectly.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is a totally different question.&lt;/P&gt;
&lt;P&gt;Why would you expect that running that data step would produce 50 observations?&lt;/P&gt;
&lt;P&gt;There is nothing in the code that would do that. It might do that if there are exactly 50 observations that do NOT get deleted by that IF statement.&amp;nbsp;But we would need to see the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 06:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394995#M3418</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-09-12T06:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394996#M3419</link>
      <description>&lt;P&gt;Ignore the colors. Look at the log. SAS will put an erorr message in the log is you ask it to run invalid code. Until you actually submit the code to run the editor is just an editor. It doesn't really know whether you are typing SAS code or your shopping list.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 06:06:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394996#M3419</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-09-12T06:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394997#M3420</link>
      <description>&lt;P&gt;You're right the statement is really meaningless I was just simply showing the compiler is not picking up the delete statement, and the log had no errors.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if Total&amp;gt;=50 and NumQtrs=4; &amp;lt;--- this statement produced 50 observations like the questioni wanted.&lt;/P&gt;&lt;P&gt;so shouldn't&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if Total&amp;lt;50 and NumQtrs^=4 then delete;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;produce 50 observations as well?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 06:11:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394997#M3420</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-09-12T06:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394998#M3421</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/68169"&gt;@syk&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;You're right the statement is really meaningless I was just simply showing the compiler is not picking up the delete statement, and the log had no errors.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if Total&amp;gt;=50 and NumQtrs=4; &amp;lt;--- this statement produced 50 observations like the questioni wanted.&lt;/P&gt;
&lt;P&gt;so shouldn't&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if Total&amp;lt;50 and NumQtrs^=4 then delete;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;produce 50 observations as well?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No. Apply DeMorgan's law. &amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/De_Morgan%27s_laws" target="_blank"&gt;https://en.wikipedia.org/wiki/De_Morgan%27s_laws&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;NOT (A and B) is the same as (NOT A) or (NOT B).&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 06:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/394998#M3421</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-09-12T06:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/395005#M3422</link>
      <description>&lt;P&gt;DeMorgan is one of the foundations of programming. As soon as one touches the first composite condition, one does not only have to &lt;EM&gt;know&lt;/EM&gt; DeMorgan's laws, one needs to &lt;EM&gt;internalize&lt;/EM&gt; them to the point where the hands automatically type the correct conversion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/68169"&gt;@syk&lt;/a&gt;: the coloring in the SAS enhanced editor is not complete; some keywords are not caught correctly. Follow my Maxims 4 and 2.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 06:42:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/395005#M3422</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-12T06:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/395136#M3427</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if Total&amp;gt;=50 and NumQtrs=4; &amp;lt;--- this statement produced 50 observations like the questioni wanted.&lt;/P&gt;
&lt;P&gt;so shouldn't&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if Total&amp;lt;50 and NumQtrs^=4 then delete;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;produce 50 observations as well?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, you have two conditions joined by an AND so you theoretically have 4 different possibilities (2X2)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Total &amp;gt;= 50 and NumQtrs=4&lt;/P&gt;
&lt;P&gt;Total &amp;lt; 50 and NumQtrs=4&lt;/P&gt;
&lt;P&gt;Total &amp;gt;= 50 and NumQtrs^=4&lt;/P&gt;
&lt;P&gt;Total &amp;lt; 50 and NumQtrs^=4&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 15:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/395136#M3427</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-12T15:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN/DELETE on SAS university edition not working?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/395176#M3428</link>
      <description>&lt;P&gt;If Total is missing then Total&amp;lt;50 is True.&lt;/P&gt;
&lt;P&gt;If NumQtrs is missing then NumQtrs ^= 4 is True.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you have missing values for the selection variables you may have more or fewer results than you think you should.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 17:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-DELETE-on-SAS-university-edition-not-working/m-p/395176#M3428</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-12T17:28:41Z</dc:date>
    </item>
  </channel>
</rss>

