<?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 Building an If statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Building-an-If-statement/m-p/149956#M39541</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still new to SAS and I'm not sure if it can be done but though I would&lt;BR /&gt;ask. I'm trying to build an IFF statement similar to what you can do in Access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two columns (total paid and first payment). If total paid = first payment&lt;BR /&gt;then I don't what to return anything. If total paid is &amp;gt; the first payment I&lt;BR /&gt;want to divide the total paid by first payment i.e. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Here is what I used in access&lt;/P&gt;&lt;P&gt;%CHANGE: IIf([TOTAL PAID]&amp;lt;&amp;gt;[FIRST PAYMENT AMOUNT],([TOTAL PAID]/[FIRST&lt;BR /&gt;PAYMENT AMOUNT])-1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Nov 2013 16:54:58 GMT</pubDate>
    <dc:creator>brywhi11</dc:creator>
    <dc:date>2013-11-20T16:54:58Z</dc:date>
    <item>
      <title>Building an If statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Building-an-If-statement/m-p/149956#M39541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still new to SAS and I'm not sure if it can be done but though I would&lt;BR /&gt;ask. I'm trying to build an IFF statement similar to what you can do in Access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two columns (total paid and first payment). If total paid = first payment&lt;BR /&gt;then I don't what to return anything. If total paid is &amp;gt; the first payment I&lt;BR /&gt;want to divide the total paid by first payment i.e. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Here is what I used in access&lt;/P&gt;&lt;P&gt;%CHANGE: IIf([TOTAL PAID]&amp;lt;&amp;gt;[FIRST PAYMENT AMOUNT],([TOTAL PAID]/[FIRST&lt;BR /&gt;PAYMENT AMOUNT])-1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 16:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Building-an-If-statement/m-p/149956#M39541</guid>
      <dc:creator>brywhi11</dc:creator>
      <dc:date>2013-11-20T16:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Building an If statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Building-an-If-statement/m-p/149957#M39542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's easier than you would think.&amp;nbsp; Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if total_paid ne first_payment then percent_change = (total_paid / first_payment) - 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Automatically, this statement does nothing when total_paid equals first_payment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The harder part of the question is understanding your data.&amp;nbsp; Do you really have only two columns, and not a third column identifying who is making the payment?&amp;nbsp; Do you really have a column that repeats the first payment value for every row belonging to that person?&amp;nbsp; If the answer is yes, then adding the statement above should be all you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 17:10:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Building-an-If-statement/m-p/149957#M39542</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-11-20T17:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Building an If statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Building-an-If-statement/m-p/149958#M39543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depends on where you want to "return" this value.&lt;/P&gt;&lt;P&gt;Normally for this type of calculation you would want to create a new variable.&lt;/P&gt;&lt;P&gt;Assuming you have variables named TOTAL_PAID and FIRST_PAYMENT_AMOUNT and want to create variable NEW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if total_paid = first_payment_amount then new = .;&lt;/P&gt;&lt;P&gt;else new = (total_paid/first_payment_amount) -1 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that you should not use &amp;lt;&amp;gt; to mean NOT EQUAL in SAS as that is the symbol for the MAX operator.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 17:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Building-an-If-statement/m-p/149958#M39543</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-11-20T17:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Building an If statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Building-an-If-statement/m-p/149959#M39544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 18:13:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Building-an-If-statement/m-p/149959#M39544</guid>
      <dc:creator>brywhi11</dc:creator>
      <dc:date>2013-11-20T18:13:24Z</dc:date>
    </item>
  </channel>
</rss>

