<?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 Use of IFC and IFN in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/484986#M125941</link>
    <description>As IFC and IFN can be used in place of IF-THEN-ELSE&lt;BR /&gt;But how to create more than 2 codes such as mild, moderate, and Severe.&lt;BR /&gt;&lt;BR /&gt;Do help me.</description>
    <pubDate>Wed, 08 Aug 2018 05:16:49 GMT</pubDate>
    <dc:creator>Bhavanaa44</dc:creator>
    <dc:date>2018-08-08T05:16:49Z</dc:date>
    <item>
      <title>Use of IFC and IFN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/484986#M125941</link>
      <description>As IFC and IFN can be used in place of IF-THEN-ELSE&lt;BR /&gt;But how to create more than 2 codes such as mild, moderate, and Severe.&lt;BR /&gt;&lt;BR /&gt;Do help me.</description>
      <pubDate>Wed, 08 Aug 2018 05:16:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/484986#M125941</guid>
      <dc:creator>Bhavanaa44</dc:creator>
      <dc:date>2018-08-08T05:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Use of IFC and IFN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/484992#M125946</link>
      <description>&lt;P&gt;While I generally dont like the approach, you can ise nested IFC Functions like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   do value=0 to 100;
      output;
   end;
run;

data want;
   set have;
   severity=ifc(value ge 80, "Severe", ifc(value ge 20, "Moderate", "Mild"));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Aug 2018 05:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/484992#M125946</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-08-08T05:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Use of IFC and IFN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/484997#M125950</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212167"&gt;@Bhavanaa44&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;As IFC and IFN can be used in place of IF-THEN-ELSE&lt;BR /&gt;But how to create more than 2 codes such as mild, moderate, and Severe.&lt;BR /&gt;&lt;BR /&gt;Do help me.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Use a value format with ranges. All the conditions turn into a single put().&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 05:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/484997#M125950</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-08T05:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Use of IFC and IFN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/485176#M126023</link>
      <description>&lt;P&gt;I very much agree with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;If a category is based on a single variable then a custom format is a very superior way to handling for a number of reasons.&lt;/P&gt;
&lt;P&gt;One of the most flexible elements of formats is the ability to use different formats with the same variable to create different groups for&lt;/P&gt;
&lt;P&gt;analysis or reporting. Most of the modeling, analysis and graphing procedures will honor groups created by a format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See below for an example. Notice that NO additional variables are created.&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value mild_sev
0 - 20='Mild'
20&amp;lt;-80='Moderate'
80&amp;lt;-high='Severe'
;
value mild_vsev
0 - 20='Mild'
20&amp;lt;-40='Less Moderate'
40&amp;lt;-90='High Moderate'
90&amp;lt;-high='Very Severe'
;
run;

data have;
   do value=0 to 100;
      output;
   end;
run;
title 'Mild to servere format';
proc freq data=have;
   tables value;
   format value mild_sev.;
run;
title 'Mild to very severe format';
proc freq data=have;
   tables value;
   format value mild_vsev.;
run; title;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Aug 2018 14:58:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/485176#M126023</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-08T14:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Use of IFC and IFN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/488108#M127219</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;It worked well even I tried with adding more categories as well.&lt;BR /&gt;Thanks a lot</description>
      <pubDate>Mon, 20 Aug 2018 06:45:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/488108#M127219</guid>
      <dc:creator>Bhavanaa44</dc:creator>
      <dc:date>2018-08-20T06:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Use of IFC and IFN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/488158#M127234</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212167"&gt;@Bhavanaa44&lt;/a&gt;, glad to know that it worked. However, it is a much better solution to use formats, especially when you add more categories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 11:42:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-of-IFC-and-IFN/m-p/488158#M127234</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-08-20T11:42:17Z</dc:date>
    </item>
  </channel>
</rss>

