<?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: Concatenating in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Concatenating/m-p/875660#M345992</link>
    <description>Thank you so much,i got desirable result!</description>
    <pubDate>Sun, 14 May 2023 12:37:41 GMT</pubDate>
    <dc:creator>Andrew15</dc:creator>
    <dc:date>2023-05-14T12:37:41Z</dc:date>
    <item>
      <title>Concatenating</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating/m-p/875651#M345989</link>
      <description>&lt;PRE&gt;data Karen_D2t1; 
set sashelp.cars;
 run; 

proc sort data=Karen_D2t1; 
by make type; 
run; 

proc means data=Karen_D2t1 mean; 
by make type; 
var horsepower; 
output out=a2(drop=_freq_ _type_) mean=MeanHP; 
run; 

proc means data=Karen_D2t1 mean; 
by make type;
 var invoice ; 
output out=a3(drop=_freq_ _type_) mean=MeanIN; 
run; 

proc means data=Karen_D2t1 mean;
 by make type;
 var weight; 
output out=a4(drop=_freq_ _type_) mean=MeanW; 
run; 

data a5; merge a2 a3 a4; run; 

proc transpose data=a5 out=a5t; 
var MeanHP; 
run; 

data a8; 
Length char1 $ 1500.; 
set a5t; 
char1=catx(", ", of col1-col29);
 run;&lt;/PRE&gt;&lt;P&gt;Hello. I Have i code below,in which i treied to create variable "char1" which will contain values of all variables from dataset a5t,separated by "," . And this works but i just need to get more flexible code which will work for any count of columns and not only 29 of them. Can you help me to find a solution? Would be thankful!&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2023 11:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating/m-p/875651#M345989</guid>
      <dc:creator>Andrew15</dc:creator>
      <dc:date>2023-05-14T11:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating/m-p/875654#M345990</link>
      <description>&lt;P&gt;Thank you for providing fully working sample code. That always helps a lot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just by looking at your code without even trying to understand what you want to achieve: It feels very much like there should be a simpler more direct way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But to answer your actual question: Use the column modifier and the code will pick-up all variables that start with name col.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1684065771527.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83957iA6F1509237976571/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1684065771527.png" alt="Patrick_0-1684065771527.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2023 12:04:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating/m-p/875654#M345990</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-05-14T12:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating/m-p/875660#M345992</link>
      <description>Thank you so much,i got desirable result!</description>
      <pubDate>Sun, 14 May 2023 12:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating/m-p/875660#M345992</guid>
      <dc:creator>Andrew15</dc:creator>
      <dc:date>2023-05-14T12:37:41Z</dc:date>
    </item>
  </channel>
</rss>

