<?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 IFN and IFC in SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-IFN-and-IFC-in-SQL/m-p/423707#M104230</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I use IFN and IFC in SQL?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I receive the following error when I run the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table aphase as 
  select USUBJID,
  		 ifn(length(SESTDTC)&amp;gt;10, input(SESTDTC,is8601dt.), input(SESTDTC, is8601dn.)) as PH1SDT
  from se
  where TAETORD in (4)
  order by USUBJID;
quit; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Invalid date value
NOTE: Invalid argument to function INPUT. Missing values may be generated.
NOTE: Table WORK.APHASE11 created, with 44 rows and 2 columns.

14580  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or, possibly it is a problem with is8601dn. format ?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Dec 2017 11:24:32 GMT</pubDate>
    <dc:creator>DmytroYermak</dc:creator>
    <dc:date>2017-12-27T11:24:32Z</dc:date>
    <item>
      <title>Using IFN and IFC in SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-IFN-and-IFC-in-SQL/m-p/423707#M104230</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I use IFN and IFC in SQL?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I receive the following error when I run the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table aphase as 
  select USUBJID,
  		 ifn(length(SESTDTC)&amp;gt;10, input(SESTDTC,is8601dt.), input(SESTDTC, is8601dn.)) as PH1SDT
  from se
  where TAETORD in (4)
  order by USUBJID;
quit; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Invalid date value
NOTE: Invalid argument to function INPUT. Missing values may be generated.
NOTE: Table WORK.APHASE11 created, with 44 rows and 2 columns.

14580  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or, possibly it is a problem with is8601dn. format ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 11:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-IFN-and-IFC-in-SQL/m-p/423707#M104230</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-12-27T11:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using IFN and IFC in SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-IFN-and-IFC-in-SQL/m-p/423708#M104231</link>
      <description>&lt;P&gt;IFN/IFC is supported, but your log message is not about that, is about invalid date values.&lt;/P&gt;
&lt;P&gt;Also, not sure if IFN/IFC functions gain you something in SQL, where you have CASE.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 11:45:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-IFN-and-IFC-in-SQL/m-p/423708#M104231</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-12-27T11:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using IFN and IFC in SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-IFN-and-IFC-in-SQL/m-p/423717#M104233</link>
      <description>&lt;P&gt;I had no choice but to change on 'case when':&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table aphase as 
  select USUBJID,
  		 case when length(SESTDTC)&amp;gt;10 then datepart(input(SESTDTC,is8601dt.))
			  else datepart(input(SESTDTC, is8601dn.))
			  end as PH1SDT
  from se
  where TAETORD in (4)
  order by USUBJID; 

quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Dec 2017 12:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-IFN-and-IFC-in-SQL/m-p/423717#M104233</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-12-27T12:32:03Z</dc:date>
    </item>
  </channel>
</rss>

