<?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: How to change cells value to different with IF function? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188312#M3884</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just first which crossed my mind - it's often in use in programming&lt;/P&gt;&lt;P&gt;I'm using Data Integration Studio&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you tell me which one is a proper one for me and how to fill that function?&lt;/P&gt;&lt;P&gt;COALESCE(/*any-type, any-union-compatible-type*/)&lt;/P&gt;&lt;P&gt;COALESCE(expr [, expr ]...)&lt;/P&gt;&lt;P&gt;COALESCE( scalar_expression,scalar_expression,...)&lt;/P&gt;&lt;P&gt;COALESCE(&amp;lt;value&amp;gt;)&lt;/P&gt;&lt;P&gt;SELECT COALESCE ( &amp;lt;expression1&amp;gt;, &amp;lt;exprression2&amp;gt;, ...[exprN] )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 18 Jan 2015 12:29:09 GMT</pubDate>
    <dc:creator>jarr25</dc:creator>
    <dc:date>2015-01-18T12:29:09Z</dc:date>
    <item>
      <title>How to change cells value to different with IF function?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188310#M3882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have some problem with my SAS &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to do, it's basically changing column value with function IF.&lt;/P&gt;&lt;P&gt;So i have that type of column:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="8764" alt="" class="jiveImage" src="https://communities.sas.com/legacyfs/online/8764_pastedImage_2.png" style="width: 93px; height: 188px;" title=" " /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need, is that blank cells (dots) to be filled with text 1501018, if there text in it already, it should leave it.&lt;/P&gt;&lt;P&gt;Could you explain me how to do that, please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to do it with IF function, but I have some problems with it..&lt;/P&gt;&lt;P&gt;It would be:&lt;/P&gt;&lt;P&gt;IF(/*expr1,expr2,expr3*/)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;changed to&lt;/P&gt;&lt;P&gt;IF(/*ENDDATE = .. ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 12:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188310#M3882</guid>
      <dc:creator>jarr25</dc:creator>
      <dc:date>2015-01-18T12:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to change cells value to different with IF function?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188311#M3883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why have you chosen the if() functions specifically?&lt;/P&gt;&lt;P&gt;What programming environment are you using?&lt;/P&gt;&lt;P&gt;The coalesce() function would probably be a better fit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 12:20:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188311#M3883</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-01-18T12:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to change cells value to different with IF function?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188312#M3884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just first which crossed my mind - it's often in use in programming&lt;/P&gt;&lt;P&gt;I'm using Data Integration Studio&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you tell me which one is a proper one for me and how to fill that function?&lt;/P&gt;&lt;P&gt;COALESCE(/*any-type, any-union-compatible-type*/)&lt;/P&gt;&lt;P&gt;COALESCE(expr [, expr ]...)&lt;/P&gt;&lt;P&gt;COALESCE( scalar_expression,scalar_expression,...)&lt;/P&gt;&lt;P&gt;COALESCE(&amp;lt;value&amp;gt;)&lt;/P&gt;&lt;P&gt;SELECT COALESCE ( &amp;lt;expression1&amp;gt;, &amp;lt;exprression2&amp;gt;, ...[exprN] )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 12:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188312#M3884</guid>
      <dc:creator>jarr25</dc:creator>
      <dc:date>2015-01-18T12:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to change cells value to different with IF function?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188313#M3885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if missing(enddate) then enddate=&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;1501018 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 13:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188313#M3885</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-18T13:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to change cells value to different with IF function?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188314#M3886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's not working for me, would you have other ideas? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 15:18:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188314#M3886</guid>
      <dc:creator>jarr25</dc:creator>
      <dc:date>2015-01-18T15:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to change cells value to different with IF function?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188315#M3887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you have a numeric variable that is formatted as a DATETIME value.&lt;/P&gt;&lt;P&gt;The value you want to display does not look like a date time since if it was it would be just before 9AM on Jan 18th, 1960.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot put text into a numeric variable.&lt;/P&gt;&lt;P&gt;You could create a custom format.&lt;/P&gt;&lt;P&gt;proc format ;&lt;/P&gt;&lt;P&gt; value enddate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = '1501018'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; other = [DATETIME20.];&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 15:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188315#M3887</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-01-18T15:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to change cells value to different with IF function?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188316#M3888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;*Assuming your enddate has datetime values, so covert the variable value to character and replace missing with your given character constant;&lt;/P&gt;&lt;P&gt;data have;/*test dataset*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; enddate='18jan2015:11:43:20'dt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length new_enddate $19 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_enddate=put(enddate,is8601dt.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i =1 to 5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i&amp;gt;2 then new_enddate=" ";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data want(drop=i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if missing(new_enddate) then new_enddate="1501018";&lt;/P&gt;&lt;P&gt;&amp;nbsp; format enddate datetime18.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 15:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188316#M3888</guid>
      <dc:creator>naveen_srini</dc:creator>
      <dc:date>2015-01-18T15:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to change cells value to different with IF function?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188317#M3889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the coalesce function would be as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;coalesce(enddate,150108)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 19:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188317#M3889</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-18T19:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to change cells value to different with IF function?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188318#M3890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DI Studio, which transformation?&lt;/P&gt;&lt;P&gt;And how does it not work?&lt;/P&gt;&lt;P&gt;And what kind of value is 150108 anyway? It does not make sense as a datetime value (02JAN60:17:41:48).&lt;/P&gt;&lt;P&gt;Do you refer to 8th ofj fanuary 2015?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;coalesce(enddate, "8Jan2015:00:00:"dt)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 21:19:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188318#M3890</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-01-18T21:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to change cells value to different with IF function?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188319#M3891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you are using a DI join transformation, you may need to use a "case when" statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;case when enddate = . &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;then 1&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;501018 &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;else enddate &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;although you might need to sort out your formats&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 04:19:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-change-cells-value-to-different-with-IF-function/m-p/188319#M3891</guid>
      <dc:creator>Shirki</dc:creator>
      <dc:date>2015-01-22T04:19:40Z</dc:date>
    </item>
  </channel>
</rss>

