<?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: to combine 2 character columns into one new column in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/326937#M62372</link>
    <description>&lt;P&gt;Thank you for your reply.&amp;nbsp; I've tried your query, the new column was added and it's blank, even col1 and col2 show some characters.&amp;nbsp; what could be a reason why this returns blank?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if I want to have space or underscore between col1 and col2, how can I adjust cats formula?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SKP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jan 2017 04:40:30 GMT</pubDate>
    <dc:creator>SKP</dc:creator>
    <dc:date>2017-01-24T04:40:30Z</dc:date>
    <item>
      <title>to combine 2 character columns into one new column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/326932#M62370</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 character columns in a table, and am tring to combine the 2 columns&amp;nbsp;into new column, like I can concatenate in excel.&lt;/P&gt;&lt;P&gt;How can i combine the 2 with SQL query?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SKP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 04:17:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/326932#M62370</guid>
      <dc:creator>SKP</dc:creator>
      <dc:date>2017-01-24T04:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: to combine 2 character columns into one new column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/326936#M62371</link>
      <description>&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;create table want as select *,&amp;nbsp; cats(col1,col2) as new_column from have;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 04:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/326936#M62371</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-01-24T04:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: to combine 2 character columns into one new column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/326937#M62372</link>
      <description>&lt;P&gt;Thank you for your reply.&amp;nbsp; I've tried your query, the new column was added and it's blank, even col1 and col2 show some characters.&amp;nbsp; what could be a reason why this returns blank?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if I want to have space or underscore between col1 and col2, how can I adjust cats formula?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SKP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 04:40:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/326937#M62372</guid>
      <dc:creator>SKP</dc:creator>
      <dc:date>2017-01-24T04:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: to combine 2 character columns into one new column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/326940#M62374</link>
      <description>&lt;P&gt;Look at CATX instead then.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-concatenate-values-in-SAS/ta-p/494125" target="_self"&gt;How to concatenate values in SAS for function definitions and examples&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0wzddkqqeo6pun1tba7l09dkkq8.htm&amp;amp;locale=en" target="_self"&gt;list of SAS functions can be found here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 20:21:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/326940#M62374</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-31T20:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: to combine 2 character columns into one new column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/326998#M62375</link>
      <description>&lt;P&gt;We have no way of telling. &amp;nbsp;You have not provided any test data, example output, logs etc. to make any kind of judgement. &amp;nbsp;If you want good answers then post good questions. &amp;nbsp;Post example test data, in the form of a datastep, which highlights your question. &amp;nbsp;If you have some code or example output, then provide that as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As per the manual, cats, catx, catt, cat, || are all concatentation functions - you can find more information in the manual on each. &amp;nbsp;They can be used in proc SQL - as long as it is not pass-through SQL - and should work perfectly well.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 10:04:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/326998#M62375</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-24T10:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: to combine 2 character columns into one new column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/473168#M71025</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;Hi, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;Suppose you got this dataset and want to combine two columns&amp;nbsp;:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; ddd;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;input&lt;/SPAN&gt; ID var1 $ var2 $;&lt;/P&gt;&lt;P&gt;cards&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1 a .&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2 . b&lt;/P&gt;&lt;P&gt;3 . c&lt;/P&gt;&lt;P&gt;4 d .&lt;/P&gt;&lt;P&gt;5 e .&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;select&lt;/SPAN&gt; coalesce(var1,var2) &lt;SPAN&gt;as&lt;/SPAN&gt; combine_var&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;from&lt;/SPAN&gt; ddd;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2018 21:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/to-combine-2-character-columns-into-one-new-column/m-p/473168#M71025</guid>
      <dc:creator>hmoghul</dc:creator>
      <dc:date>2018-06-25T21:04:47Z</dc:date>
    </item>
  </channel>
</rss>

