<?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: Question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Question-SQL-to-generate-comma-separated-result/m-p/781039#M248916</link>
    <description>&lt;P&gt;I don't think it's doable (easily) in SQL, but it's easy in a data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input time name $;
datalines;
1 Alfred
1 Charles
2 Susy
2 John
3 James
;

data want;
set have;
by time;
retain all_names;
length all_names $100;
if first.time
then all_names = name;
else all_names = catx(",",all_names,name);
if last.time;
drop name;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 18 Nov 2021 14:41:34 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-11-18T14:41:34Z</dc:date>
    <item>
      <title>Question - SQL to generate comma-separated result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-SQL-to-generate-comma-separated-result/m-p/781034#M248914</link>
      <description>&lt;P&gt;So I am super new to proc sql.&lt;BR /&gt;&lt;BR /&gt;My question is, can I have names of people populate in one column if they fit the condition, separated by a comma?&lt;BR /&gt;&lt;BR /&gt;Like if there is a data set where people on a certain day at a certain time eat a piece of red candy, all the names of those people who fit that populate in one column separated by a comma? But still keep the other stuff like date and time distinct?&lt;BR /&gt;&lt;BR /&gt;I hope I’m asking this correctly&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 14:44:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-SQL-to-generate-comma-separated-result/m-p/781034#M248914</guid>
      <dc:creator>GiMaAsh</dc:creator>
      <dc:date>2021-11-18T14:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-SQL-to-generate-comma-separated-result/m-p/781039#M248916</link>
      <description>&lt;P&gt;I don't think it's doable (easily) in SQL, but it's easy in a data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input time name $;
datalines;
1 Alfred
1 Charles
2 Susy
2 John
3 James
;

data want;
set have;
by time;
retain all_names;
length all_names $100;
if first.time
then all_names = name;
else all_names = catx(",",all_names,name);
if last.time;
drop name;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Nov 2021 14:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-SQL-to-generate-comma-separated-result/m-p/781039#M248916</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-18T14:41:34Z</dc:date>
    </item>
  </channel>
</rss>

