<?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: Storing negative numbers in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Storing-negative-numbers/m-p/96256#M20299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input type $1-7&amp;nbsp; amount;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;credit&amp;nbsp; 1000&lt;/P&gt;&lt;P&gt;debit&amp;nbsp;&amp;nbsp; 2000&lt;/P&gt;&lt;P&gt;unknown 3000&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; set have;&lt;/P&gt;&lt;P&gt; if upcase(type) eq 'CREDIT' then amount=0-amount;&lt;/P&gt;&lt;P&gt; else amount=amount;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Apr 2012 20:13:58 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2012-04-26T20:13:58Z</dc:date>
    <item>
      <title>Storing negative numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-negative-numbers/m-p/96255#M20298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have data with type and amount columns.&amp;nbsp; Wheres type can be debit or credit.&amp;nbsp; Depanding on type i would to store the amount in positive or negative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the type is credit then i would like to store amount value in negative&amp;nbsp; "-1000" else positive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, is it good idea to store the negative values in table or to calculate the values at query level for reporting ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2012 19:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-negative-numbers/m-p/96255#M20298</guid>
      <dc:creator>newbi</dc:creator>
      <dc:date>2012-04-26T19:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Storing negative numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-negative-numbers/m-p/96256#M20299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input type $1-7&amp;nbsp; amount;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;credit&amp;nbsp; 1000&lt;/P&gt;&lt;P&gt;debit&amp;nbsp;&amp;nbsp; 2000&lt;/P&gt;&lt;P&gt;unknown 3000&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; set have;&lt;/P&gt;&lt;P&gt; if upcase(type) eq 'CREDIT' then amount=0-amount;&lt;/P&gt;&lt;P&gt; else amount=amount;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2012 20:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-negative-numbers/m-p/96256#M20299</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2012-04-26T20:13:58Z</dc:date>
    </item>
  </channel>
</rss>

