<?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: Concatenation with array in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389750#M277556</link>
    <description>&lt;P&gt;Are they all called colX if so you don't need an array:&lt;/P&gt;
&lt;PRE&gt;result=catx(',',of col:);&lt;/PRE&gt;
&lt;P&gt;Note the colon after the col prefix.&lt;/P&gt;
&lt;P&gt;If they are not all called that then:&lt;/P&gt;
&lt;PRE&gt;array tmp{*} col1 abc def;
result=catx(',',of tmp:);&lt;/PRE&gt;</description>
    <pubDate>Tue, 22 Aug 2017 09:57:35 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-08-22T09:57:35Z</dc:date>
    <item>
      <title>Concatenation with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389747#M277555</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi SAS Experts,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a data with name and strings, I want to add all the strings(col1,col2,etc..) into one column. The number of strings are not fixed they may be more or less sometimes. I can do this with catx but do not know how to achieve this with array. Below is my data set. &amp;nbsp;Please Guide.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data a;&lt;BR /&gt;input name$ col1$ col2$ col3$ col4$;&lt;BR /&gt;DATALINES;&lt;BR /&gt;Harry abc dcd vgd bvd&lt;BR /&gt;peter cvc fgf ghg ghh&lt;BR /&gt;John fgg ftg uty gfdg&lt;BR /&gt;sheyala fgf jty fhf fgr&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;length result $50;&lt;BR /&gt;set a;&lt;BR /&gt;result=Compress(catx(';',of col1-col4),'0D0A'x);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the number of strings are not fixed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 09:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389747#M277555</guid>
      <dc:creator>sanjay1</dc:creator>
      <dc:date>2017-08-22T09:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389750#M277556</link>
      <description>&lt;P&gt;Are they all called colX if so you don't need an array:&lt;/P&gt;
&lt;PRE&gt;result=catx(',',of col:);&lt;/PRE&gt;
&lt;P&gt;Note the colon after the col prefix.&lt;/P&gt;
&lt;P&gt;If they are not all called that then:&lt;/P&gt;
&lt;PRE&gt;array tmp{*} col1 abc def;
result=catx(',',of tmp:);&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Aug 2017 09:57:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389750#M277556</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-22T09:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389763#M277557</link>
      <description>&lt;P&gt;Hi RW9,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Can you elaborate how to use this with array.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 11:05:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389763#M277557</guid>
      <dc:creator>sanjay1</dc:creator>
      <dc:date>2017-08-22T11:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389767#M277558</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/91059"&gt;@sanjay1&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi RW9,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Can you elaborate how to use this with array.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There's nothing to elaborate. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;'s post contains a complete example.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 11:12:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389767#M277558</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-22T11:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389832#M277559</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/91059"&gt;@sanjay1&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi RW9,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Can you elaborate how to use this with array.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Use "of arrayname(*)" where your are currently using "of col1-col4". BUT you must define the array beforehand.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 14:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389832#M277559</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-22T14:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389850#M277560</link>
      <description>If you need a solution like this, it's clearly homework so review your course notes or the documentation on how to reference "variable lists". The answer is on this page:&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#p0wphcpsfgx6o7n1sjtqzizp1n39.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#p0wphcpsfgx6o7n1sjtqzizp1n39.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;BTW the answer on SO is incorrect. It does work, but if that's the homework question it's highly likely that's not the correct answer.</description>
      <pubDate>Tue, 22 Aug 2017 15:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-with-array/m-p/389850#M277560</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-22T15:20:39Z</dc:date>
    </item>
  </channel>
</rss>

