<?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: Help!! SAS Enterprise advanced expression nested if-then statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-SAS-Enterprise-advanced-expression-nested-if-then-statement/m-p/623159#M183398</link>
    <description>&lt;P&gt;If you provide some example data and the log it would be helpful in troubleshooting what your issue is.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below I've provided an example of what I assume you are trying to do. You can try to make necessary corrections on your side from there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input a b c d;
	datalines;
	1 . . .
	. 3 . .
	. . 4 .
	. . . 2
	;
run;

data want;
	set have;
	test = ifn(not missing(a), a, ifn(not missing(b), b, ifn(not missing(c), c, ifn(not missing(d), d,0))));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 07 Feb 2020 20:21:22 GMT</pubDate>
    <dc:creator>Krueger</dc:creator>
    <dc:date>2020-02-07T20:21:22Z</dc:date>
    <item>
      <title>Help!! SAS Enterprise advanced expression nested if-then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-SAS-Enterprise-advanced-expression-nested-if-then-statement/m-p/623149#M183394</link>
      <description>&lt;P&gt;Please help -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to have an end result of one number from 4 columns.&amp;nbsp; If column 1 is not blank, then show column 1, if it is blank, show column 2, if column 2 blank show column 3, if column 3 blank use column 4 and if column 4 is blank, leave blank.&amp;nbsp; I used the following expression but I am clearly doing something wrong.&amp;nbsp; Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ifn(t1.'Material Group'n not missing,t1.'Material Group'n, ifn(t1.'Material Group #'n not missing, t1.'Material Group #'n), ifn(t1.'Matl Grp'n not missing, t1.'Matl Grp'n, ifn(t1.'Material Group #1'n not missing, t1.'Material Group #1'n, "")))&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 19:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-SAS-Enterprise-advanced-expression-nested-if-then-statement/m-p/623149#M183394</guid>
      <dc:creator>maliksmom2000</dc:creator>
      <dc:date>2020-02-07T19:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help!! SAS Enterprise advanced expression nested if-then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-SAS-Enterprise-advanced-expression-nested-if-then-statement/m-p/623159#M183398</link>
      <description>&lt;P&gt;If you provide some example data and the log it would be helpful in troubleshooting what your issue is.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below I've provided an example of what I assume you are trying to do. You can try to make necessary corrections on your side from there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input a b c d;
	datalines;
	1 . . .
	. 3 . .
	. . 4 .
	. . . 2
	;
run;

data want;
	set have;
	test = ifn(not missing(a), a, ifn(not missing(b), b, ifn(not missing(c), c, ifn(not missing(d), d,0))));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Feb 2020 20:21:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-SAS-Enterprise-advanced-expression-nested-if-then-statement/m-p/623159#M183398</guid>
      <dc:creator>Krueger</dc:creator>
      <dc:date>2020-02-07T20:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help!! SAS Enterprise advanced expression nested if-then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-SAS-Enterprise-advanced-expression-nested-if-then-statement/m-p/623160#M183399</link>
      <description>use coalescec.</description>
      <pubDate>Fri, 07 Feb 2020 20:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-SAS-Enterprise-advanced-expression-nested-if-then-statement/m-p/623160#M183399</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2020-02-07T20:23:29Z</dc:date>
    </item>
  </channel>
</rss>

