<?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 Combine column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Combine-column/m-p/793717#M254434</link>
    <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ive two column (Char,Code) and I just want to combine them (into result). But how? Could you pls help me with SAS- and SQL-command? &lt;STRONG&gt;Thank you!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 180pt;" border="0" width="240" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 12.0pt;"&gt;
&lt;TD width="80" height="16" style="height: 12.0pt; width: 60pt;"&gt;Char&lt;/TD&gt;
&lt;TD width="80" style="width: 60pt;"&gt;Code&lt;/TD&gt;
&lt;TD width="80" style="width: 60pt;"&gt;Result&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 12.0pt;"&gt;
&lt;TD height="16" style="height: 12.0pt;"&gt;KA&lt;/TD&gt;
&lt;TD align="right"&gt;14523&lt;/TD&gt;
&lt;TD&gt;KA14523&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Tue, 01 Feb 2022 10:27:01 GMT</pubDate>
    <dc:creator>Konkordanz</dc:creator>
    <dc:date>2022-02-01T10:27:01Z</dc:date>
    <item>
      <title>Combine column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combine-column/m-p/793717#M254434</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ive two column (Char,Code) and I just want to combine them (into result). But how? Could you pls help me with SAS- and SQL-command? &lt;STRONG&gt;Thank you!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 180pt;" border="0" width="240" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 12.0pt;"&gt;
&lt;TD width="80" height="16" style="height: 12.0pt; width: 60pt;"&gt;Char&lt;/TD&gt;
&lt;TD width="80" style="width: 60pt;"&gt;Code&lt;/TD&gt;
&lt;TD width="80" style="width: 60pt;"&gt;Result&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 12.0pt;"&gt;
&lt;TD height="16" style="height: 12.0pt;"&gt;KA&lt;/TD&gt;
&lt;TD align="right"&gt;14523&lt;/TD&gt;
&lt;TD&gt;KA14523&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Tue, 01 Feb 2022 10:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combine-column/m-p/793717#M254434</guid>
      <dc:creator>Konkordanz</dc:creator>
      <dc:date>2022-02-01T10:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Combine column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combine-column/m-p/793718#M254435</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Result = cats(Char, Code);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Feb 2022 10:32:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combine-column/m-p/793718#M254435</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-02-01T10:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Combine column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combine-column/m-p/793735#M254444</link>
      <description>&lt;P&gt;Yes, the simplest answer is given by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, you might want to familiarize yourself with the entire family of CAT functions as they may be helpful in other situations&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/ds2ref/n0somj6dsx2dmkn1vqjabhvt6nv4.htm" target="_self"&gt;CAT&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/n11fqp8lmm22sen1cxlzksrtfefo.htm" target="_self"&gt;CATQ&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/n1e21rr6al5m2nn19r1fat5qxwrt.htm" target="_self"&gt;CATS&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/n16y1vyi397p84n19dpvzw0pemsa.htm" target="_self"&gt;CATT&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/n0p7wxtk0hvn83n1pveisbcp2ae9.htm" target="_self"&gt;CATX&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;DOGX (&amp;lt;- there is no such thing)&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 11:49:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combine-column/m-p/793735#M254444</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-01T11:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Combine column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combine-column/m-p/793815#M254471</link>
      <description>&lt;P&gt;If your code variable is numeric you need to consider cases of differing number of digits and what you expect for the result. If you always want 5 digits in the combined value and the Code value is less than 10000 you may need to control the conversion to character as the default may not yield the desired need.&lt;/P&gt;
&lt;PRE&gt;data example;
   char ='ABC';
   code = 3;
   combined= cats(char,code);
   combined2 = cats(char,put(code,z5.));
   put combined= combined2=;
run;&lt;/PRE&gt;
&lt;P&gt;Yields:&lt;/P&gt;
&lt;PRE&gt;combined=ABC3 combined2=ABC00003
&lt;/PRE&gt;
&lt;P&gt;The automatic conversion to character for the CAT (and most functions) will use a BEST format which may have fewer digits than you want/need/expect.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 15:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combine-column/m-p/793815#M254471</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-01T15:09:24Z</dc:date>
    </item>
  </channel>
</rss>

