<?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: coalescec in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/coalescec/m-p/887726#M350712</link>
    <description>&lt;P&gt;What is the logic rule for selecting the output value?&amp;nbsp; It's not the first, not the last, not the first letter... I can't see what the rule is.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2023 15:05:11 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2023-08-03T15:05:11Z</dc:date>
    <item>
      <title>coalescec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coalescec/m-p/887724#M350711</link>
      <description>&lt;P&gt;I had tried many codes but didn't get solution help me to find out solution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data m;&lt;BR /&gt;input v1$ v2$ v3$ v4$;&lt;BR /&gt;cards;&lt;BR /&gt;v&amp;nbsp; 1&amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp;2&lt;BR /&gt;.&amp;nbsp; &amp;nbsp;2&amp;nbsp; b&amp;nbsp; f&lt;BR /&gt;.&amp;nbsp; &amp;nbsp; .&amp;nbsp; 4&amp;nbsp; 6&lt;BR /&gt;2&amp;nbsp; .&amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp;9&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Need output like this&amp;nbsp;&lt;BR /&gt;1&lt;BR /&gt;b&lt;BR /&gt;6&lt;BR /&gt;9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 14:58:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coalescec/m-p/887724#M350711</guid>
      <dc:creator>112211</dc:creator>
      <dc:date>2023-08-03T14:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: coalescec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coalescec/m-p/887726#M350712</link>
      <description>&lt;P&gt;What is the logic rule for selecting the output value?&amp;nbsp; It's not the first, not the last, not the first letter... I can't see what the rule is.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 15:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coalescec/m-p/887726#M350712</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-08-03T15:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: coalescec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coalescec/m-p/887728#M350714</link>
      <description>&lt;P&gt;Rules.&lt;/P&gt;
&lt;P&gt;Computer programs are rules.&lt;/P&gt;
&lt;P&gt;I can make your result. But it will not work for anything other than those exact values because you have not provided an rules related to how which value is selected on each row.&lt;/P&gt;
&lt;P&gt;If the rule is "second non-missing value" then one way &lt;/P&gt;
&lt;PRE&gt;data want;
  set m;
  length value $ 8;
   value = scan(catx(',',of v:),2,',');
run;&lt;/PRE&gt;
&lt;P&gt;which builds a list of values separated by commas with CATX. The Catx function remove trailing blanks so the missing values aren't included when the commas are inserted. The Scan gets the second value.&lt;/P&gt;
&lt;P&gt;Note: if your values actually include a comma then use a different character in the first parameter for Catx and the last in Scan.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 15:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coalescec/m-p/887728#M350714</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-08-03T15:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: coalescec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coalescec/m-p/887731#M350716</link>
      <description>Use coalescec function or mixed of coalescec and other functions</description>
      <pubDate>Thu, 03 Aug 2023 15:33:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coalescec/m-p/887731#M350716</guid>
      <dc:creator>112211</dc:creator>
      <dc:date>2023-08-03T15:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: coalescec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coalescec/m-p/887756#M350729</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/446448"&gt;@112211&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Use coalescec function or mixed of coalescec and other functions&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Still not a rule on selecting which values and COALESCE functions select the first that appear in a list of values. So obviously not the the choice for the given example.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 16:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coalescec/m-p/887756#M350729</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-08-03T16:41:03Z</dc:date>
    </item>
  </channel>
</rss>

