<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-then-do/m-p/578563#M164098</link>
    <description>&lt;P&gt;You miss a semicolon after do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;lagdummy - dummy =1  then do ;

if (dummy = 0 and count &amp;gt; 2) or   ( dummy= 1 and count &amp;gt; 3) then output;

end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Aug 2019 20:15:25 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2019-08-01T20:15:25Z</dc:date>
    <item>
      <title>If then do</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-then-do/m-p/578558#M164097</link>
      <description>&lt;P&gt;Hello SAS support community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on the following code but keep having errors on the THIRD PART while the first two parts are fine. Thank you so much in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=lag&amp;nbsp; &amp;nbsp;out=temp2;&lt;BR /&gt;by key fyear dummy lagdummy;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data test2;&lt;BR /&gt;set temp2;&lt;BR /&gt;by dummy notsorted;&lt;BR /&gt;if last.dummy;&lt;BR /&gt;count = _n_ - sum(lag(_n_), 0);&lt;BR /&gt;do _n_ = 1 to count;&lt;BR /&gt;set temp2;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data final2;&lt;BR /&gt;set test2;&lt;BR /&gt;by key ;&lt;BR /&gt;if&lt;BR /&gt;lagdummy - dummy =1&amp;nbsp; then do&lt;/P&gt;&lt;P&gt;if (dummy = 0 and count &amp;gt; 2) or&amp;nbsp; &amp;nbsp;( dummy= 1 and count &amp;gt; 3) then output;&lt;/P&gt;&lt;P&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 20:05:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-then-do/m-p/578558#M164097</guid>
      <dc:creator>mandyosu01</dc:creator>
      <dc:date>2019-08-01T20:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: If then do</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-then-do/m-p/578563#M164098</link>
      <description>&lt;P&gt;You miss a semicolon after do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;lagdummy - dummy =1  then do ;

if (dummy = 0 and count &amp;gt; 2) or   ( dummy= 1 and count &amp;gt; 3) then output;

end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Aug 2019 20:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-then-do/m-p/578563#M164098</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-08-01T20:15:25Z</dc:date>
    </item>
  </channel>
</rss>

