<?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: Joining text within group of rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Joining-text-within-group-of-rows/m-p/719129#M222624</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set have;
   by group_id;  /* assuming dataset is sorted by group_ID */
       length join_text $100;  /* adapt length to max expected */
       retain join_text;
       if first.group_ID then join_text = var1;
       else join_text = catx(',',join_text,var1);
       if last.group_id then output;
       drop var1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 13 Feb 2021 19:05:35 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2021-02-13T19:05:35Z</dc:date>
    <item>
      <title>Joining text within group of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joining-text-within-group-of-rows/m-p/719126#M222622</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;My data is as below, each group_id has multiple row.&lt;/P&gt;
&lt;P&gt;I want to join the text within each group_id.&lt;/P&gt;
&lt;P&gt;For group_id=1, it has 3 rows with var =x, yy, zzz.&lt;/P&gt;
&lt;P&gt;The output should have 2 columns&lt;/P&gt;
&lt;P&gt;group_id | join_text&lt;/P&gt;
&lt;P&gt;1 | x, yy, zzz&lt;/P&gt;
&lt;P&gt;2 | aaa, b&lt;/P&gt;
&lt;P&gt;3 | c&lt;/P&gt;
&lt;P&gt;Can you please help me to get it?&lt;/P&gt;
&lt;P&gt;Thank you so much.&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
input group_id var1 $;
datalines;
1 x
1 yy
1 zzz
2 aaa
2 b
3 c
;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Feb 2021 18:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joining-text-within-group-of-rows/m-p/719126#M222622</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2021-02-13T18:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Joining text within group of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joining-text-within-group-of-rows/m-p/719129#M222624</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set have;
   by group_id;  /* assuming dataset is sorted by group_ID */
       length join_text $100;  /* adapt length to max expected */
       retain join_text;
       if first.group_ID then join_text = var1;
       else join_text = catx(',',join_text,var1);
       if last.group_id then output;
       drop var1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Feb 2021 19:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joining-text-within-group-of-rows/m-p/719129#M222624</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-02-13T19:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Joining text within group of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joining-text-within-group-of-rows/m-p/719137#M222631</link>
      <description>&lt;P&gt;Thank you, Shmuel!&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;</description>
      <pubDate>Sat, 13 Feb 2021 19:50:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joining-text-within-group-of-rows/m-p/719137#M222631</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2021-02-13T19:50:07Z</dc:date>
    </item>
  </channel>
</rss>

