<?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: merging data into a single column in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/merging-data-into-a-single-column/m-p/606169#M17359</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will you be having only one payment and the rest are missing? Then as others suggested coalesce will work fine, but if you have multiple payments and would like to sum them then use sum() function which ignores missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	Payment=sum(of Payment:);
    keep Case Payment;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Nov 2019 15:20:50 GMT</pubDate>
    <dc:creator>SuryaKiran</dc:creator>
    <dc:date>2019-11-21T15:20:50Z</dc:date>
    <item>
      <title>merging data into a single column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-data-into-a-single-column/m-p/606147#M17355</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following data structure and am wondering how to get the second data structure from SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have:&lt;/P&gt;&lt;P&gt;Case&amp;nbsp; Payment1 Payment2&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$200&amp;nbsp;&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$300&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want:&lt;/P&gt;&lt;P&gt;Case&amp;nbsp; PaymentNew&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $200&amp;nbsp;&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$300&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this particular case, payment 1 and 2 are mutually exclusive so only one (not both) is paid per case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Laura&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 14:29:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-data-into-a-single-column/m-p/606147#M17355</guid>
      <dc:creator>lmyers2</dc:creator>
      <dc:date>2019-11-21T14:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: merging data into a single column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-data-into-a-single-column/m-p/606148#M17356</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/165633"&gt;@lmyers2&lt;/a&gt;&amp;nbsp; Use coalesce function&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 14:30:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-data-into-a-single-column/m-p/606148#M17356</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-11-21T14:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: merging data into a single column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-data-into-a-single-column/m-p/606149#M17357</link>
      <description>&lt;P&gt;Do like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Case Payment1 Payment2;
datalines;
1 100 .
2 . 200 
3 300 .
;

data want;
	set have;
	Payment=coalesce(of Payment:);
    keep Case Payment;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Case  Payment 
1     100
2     200
3     300&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 14:31:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-data-into-a-single-column/m-p/606149#M17357</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-11-21T14:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: merging data into a single column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-data-into-a-single-column/m-p/606169#M17359</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will you be having only one payment and the rest are missing? Then as others suggested coalesce will work fine, but if you have multiple payments and would like to sum them then use sum() function which ignores missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	Payment=sum(of Payment:);
    keep Case Payment;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Nov 2019 15:20:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-data-into-a-single-column/m-p/606169#M17359</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2019-11-21T15:20:50Z</dc:date>
    </item>
  </channel>
</rss>

