<?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 Calculate a missing field in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-a-missing-field/m-p/17548#M3165</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art297 has a good suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also used this method with success - basically I test if Price is empty and only do the calculation if it's not.&amp;nbsp; My else value can be 0 indicating no change or it could be amount if that makes more sense in your calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,case&lt;/P&gt;&lt;P&gt;when price ge 0 then Amt - price&lt;/P&gt;&lt;P&gt;else 0 /*You may want this to be Amt*/&lt;/P&gt;&lt;P&gt;end as new_var &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Feb 2012 00:05:44 GMT</pubDate>
    <dc:creator>TriciaA</dc:creator>
    <dc:date>2012-02-29T00:05:44Z</dc:date>
    <item>
      <title>Calculate a missing field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-a-missing-field/m-p/17546#M3163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to do a calculated column in my SQL that takes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Merchandise_AMT - Changed_Price&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several instances where the value in changed price is '.'&amp;nbsp;&amp;nbsp; I tried doing a missing statement to replace all '.' with '0' but the calculation had the same affect.&amp;nbsp; Does anyone know how to treat the '.' as an actual zero so the calculation will work as intended?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DZ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 23:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-a-missing-field/m-p/17546#M3163</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2012-02-28T23:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a missing field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-a-missing-field/m-p/17547#M3164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't test it at the moment, but how about if you use the sum function?&amp;nbsp; e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input x y;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 2&lt;/P&gt;&lt;P&gt;1 .&lt;/P&gt;&lt;P&gt;5 7&lt;/P&gt;&lt;P&gt;7 5&lt;/P&gt;&lt;P&gt;. 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *,sum(x,y*-1) as diff&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from have&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 00:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-a-missing-field/m-p/17547#M3164</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-29T00:00:54Z</dc:date>
    </item>
    <item>
      <title>Calculate a missing field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-a-missing-field/m-p/17548#M3165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art297 has a good suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also used this method with success - basically I test if Price is empty and only do the calculation if it's not.&amp;nbsp; My else value can be 0 indicating no change or it could be amount if that makes more sense in your calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,case&lt;/P&gt;&lt;P&gt;when price ge 0 then Amt - price&lt;/P&gt;&lt;P&gt;else 0 /*You may want this to be Amt*/&lt;/P&gt;&lt;P&gt;end as new_var &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 00:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-a-missing-field/m-p/17548#M3165</guid>
      <dc:creator>TriciaA</dc:creator>
      <dc:date>2012-02-29T00:05:44Z</dc:date>
    </item>
    <item>
      <title>Calculate a missing field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-a-missing-field/m-p/17549#M3166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; God I love you guys/gals!!!&amp;nbsp; You are so smart.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank yoiu so much for all of your input... both of you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My report is finally completed!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 01:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-a-missing-field/m-p/17549#M3166</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2012-02-29T01:00:29Z</dc:date>
    </item>
  </channel>
</rss>

