<?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: Counts in if/then/else statements in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Counts-in-if-then-else-statements/m-p/75285#M21824</link>
    <description>One of many ways to write the same tests:&lt;BR /&gt;
[pre]&lt;BR /&gt;
if Retention_EndStatus ne 'CLOSED' then do;&lt;BR /&gt;
  EndStatus = 'SAVED ';&lt;BR /&gt;
  SavCnt    = 1;&lt;BR /&gt;
  Offer     = ifc( retention_fulfill ne ' ', retention_fulfill, retention_fulfilloo); &lt;BR /&gt;
end;&lt;BR /&gt;
else do;&lt;BR /&gt;
  EndStatus = 'CLOSED';&lt;BR /&gt;
  CloCnt    = 1;&lt;BR /&gt;
end;</description>
    <pubDate>Tue, 13 Oct 2009 02:49:04 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2009-10-13T02:49:04Z</dc:date>
    <item>
      <title>Counts in if/then/else statements</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counts-in-if-then-else-statements/m-p/75283#M21822</link>
      <description>I have an if then else statement (shown below) that does not seem to pull all the numbers in. Is there a problem with the Counts? Is there another way to write a statement like this?&lt;BR /&gt;
&lt;BR /&gt;
if Retention_EndStatus ne 'CLOSED' then EndStatus = 'SAVED ';&lt;BR /&gt;
                                                      else EndStatus = 'CLOSED';&lt;BR /&gt;
 if EndStatus eq 'SAVED ' then SavCnt = 1; else&lt;BR /&gt;
 if EndStatus eq 'CLOSED' then CloCnt = 1;&lt;BR /&gt;
 if EndStatus eq 'SAVED ' then do;&lt;BR /&gt;
 	if retention_fulfill ne ' ' then Offer = retention_fulfill;&lt;BR /&gt;
                                                else Offer = retention_fulfilloo;</description>
      <pubDate>Fri, 09 Oct 2009 15:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counts-in-if-then-else-statements/m-p/75283#M21822</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-09T15:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Counts in if/then/else statements</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counts-in-if-then-else-statements/m-p/75284#M21823</link>
      <description>To start with you are testing the same thing several times.  Also do you have default values for the things you are not setting in each condition?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
if Retention_EndStatus ne 'CLOSED' then Do;&lt;BR /&gt;
EndStatus = 'SAVED ';&lt;BR /&gt;
SavCnt = 1;&lt;BR /&gt;
*** What happens to CloCnt  ??? ;&lt;BR /&gt;
if retention_fulfill ne ' ' then Offer = retention_fulfill;&lt;BR /&gt;
else Offer = retention_fulfilloo; &lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
else Do;&lt;BR /&gt;
CloCnt = 1;&lt;BR /&gt;
** What happens to SavCnt ???;&lt;BR /&gt;
 EndStatus = 'CLOSED';&lt;BR /&gt;
** What happens to Offer ???;&lt;BR /&gt;
end;</description>
      <pubDate>Fri, 09 Oct 2009 15:24:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counts-in-if-then-else-statements/m-p/75284#M21823</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-10-09T15:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Counts in if/then/else statements</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counts-in-if-then-else-statements/m-p/75285#M21824</link>
      <description>One of many ways to write the same tests:&lt;BR /&gt;
[pre]&lt;BR /&gt;
if Retention_EndStatus ne 'CLOSED' then do;&lt;BR /&gt;
  EndStatus = 'SAVED ';&lt;BR /&gt;
  SavCnt    = 1;&lt;BR /&gt;
  Offer     = ifc( retention_fulfill ne ' ', retention_fulfill, retention_fulfilloo); &lt;BR /&gt;
end;&lt;BR /&gt;
else do;&lt;BR /&gt;
  EndStatus = 'CLOSED';&lt;BR /&gt;
  CloCnt    = 1;&lt;BR /&gt;
end;</description>
      <pubDate>Tue, 13 Oct 2009 02:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counts-in-if-then-else-statements/m-p/75285#M21824</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-10-13T02:49:04Z</dc:date>
    </item>
  </channel>
</rss>

