<?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 Using IF statement to substitute column values in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-IF-statement-to-substitute-column-values/m-p/159459#M12415</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to substitute blank values in column "January Estimate" with the value from "6m Avg" every time On Promotion is "N" and January estimate is "." But for On Promotion "Y" it should retain the same value in the estimate column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 578px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" width="85"&gt;ProdCode&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="121"&gt;LongDescription&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="89"&gt;QtyOnHand&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="101"&gt;On Promotion&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="118"&gt;January Estimate&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;6m Avg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="19" style="border-top: none;"&gt;1111&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;XXX&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;54&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Y&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;72&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;18&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="19" style="border-top: none;"&gt;222&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;YYY&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;33&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;N&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="19" style="border-top: none;"&gt;354656&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;ZZZ&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Y&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;61&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Dec 2014 23:00:09 GMT</pubDate>
    <dc:creator>manojdawson</dc:creator>
    <dc:date>2014-12-21T23:00:09Z</dc:date>
    <item>
      <title>Using IF statement to substitute column values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-IF-statement-to-substitute-column-values/m-p/159459#M12415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to substitute blank values in column "January Estimate" with the value from "6m Avg" every time On Promotion is "N" and January estimate is "." But for On Promotion "Y" it should retain the same value in the estimate column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 578px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" width="85"&gt;ProdCode&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="121"&gt;LongDescription&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="89"&gt;QtyOnHand&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="101"&gt;On Promotion&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="118"&gt;January Estimate&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;6m Avg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="19" style="border-top: none;"&gt;1111&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;XXX&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;54&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Y&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;72&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;18&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="19" style="border-top: none;"&gt;222&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;YYY&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;33&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;N&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="19" style="border-top: none;"&gt;354656&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;ZZZ&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Y&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;61&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 23:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-IF-statement-to-substitute-column-values/m-p/159459#M12415</guid>
      <dc:creator>manojdawson</dc:creator>
      <dc:date>2014-12-21T23:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using IF statement to substitute column values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-IF-statement-to-substitute-column-values/m-p/159460#M12416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to show example data that captures both conditions and, for clarity, what you want the resulting file to look like. I, personally, would also like to see you propose code to solve the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 23:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-IF-statement-to-substitute-column-values/m-p/159460#M12416</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-12-21T23:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using IF statement to substitute column values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-IF-statement-to-substitute-column-values/m-p/159461#M12417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, please try the below code , However i agree with Art , if you provide more details then you will get the more appropriate response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i just tried with a simple if then statement. Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if OnPromotion='N' and JanuaryEstimate eq . then JanuaryEstimate=_6mAvg;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 00:56:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-IF-statement-to-substitute-column-values/m-p/159461#M12417</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2014-12-22T00:56:30Z</dc:date>
    </item>
  </channel>
</rss>

