<?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: Combining 4 Columns in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Combining-4-Columns/m-p/606765#M17433</link>
    <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;length merged $64;&lt;/P&gt;
&lt;P&gt;merged = catx(",", of col1-col4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The catx function concatenates its arguments, separated by the first argument. It ignores missing values.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Nov 2019 04:34:49 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2019-11-24T04:34:49Z</dc:date>
    <item>
      <title>Combining 4 Columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Combining-4-Columns/m-p/606754#M17432</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to proc import an excel file with 4 columns. Then, I would like to merge all 4 columns together IN SAS. Problem is all 4 columns have a different amount of observations. So, when I proc print this, how do I merge the columns without getting any blank observations?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2019 02:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Combining-4-Columns/m-p/606754#M17432</guid>
      <dc:creator>ANGirl</dc:creator>
      <dc:date>2019-11-24T02:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 4 Columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Combining-4-Columns/m-p/606765#M17433</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;length merged $64;&lt;/P&gt;
&lt;P&gt;merged = catx(",", of col1-col4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The catx function concatenates its arguments, separated by the first argument. It ignores missing values.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2019 04:34:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Combining-4-Columns/m-p/606765#M17433</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-11-24T04:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 4 Columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Combining-4-Columns/m-p/607153#M17511</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;length merged $64;&lt;/P&gt;
&lt;P&gt;merged = catx(",", of col1-col4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The catx function concatenates its arguments, separated by the first argument. It ignores missing values.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;By default a Missing value for a numeric will appear as . in the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
    col1='abc';
    col2=.;
    col3=3;
    col4='pdq';
    merged= catx(',',of col1-col4);
run;

/* will yield Merged = "abc,.,3,pdq" */&lt;/PRE&gt;
&lt;P&gt;If you set the missing character to blank then the concatenated version will be missing&lt;/P&gt;
&lt;PRE&gt;options missing=' ';
data example;
    col1='abc';
    col2=.;
    col3=3;
    col4='pdq';
    merged= catx(',',of col1-col4);
run;

/* merged = "abc,3,pdq" */&lt;/PRE&gt;
&lt;P&gt;So if you have numeric values you may have one or more issues to resolve in determining the exact result desired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since this post started with importing Excel it is hard to determine what type of values you may have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 00:09:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Combining-4-Columns/m-p/607153#M17511</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-26T00:09:49Z</dc:date>
    </item>
  </channel>
</rss>

