<?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 Create a new data set concatenating the observations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-data-set-concatenating-the-observations/m-p/262437#M51223</link>
    <description>&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let's assume there is the following data set with one variable (country) and severa observations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;country&lt;/P&gt;&lt;P&gt;BU&lt;/P&gt;&lt;P&gt;JA&lt;/P&gt;&lt;P&gt;US&lt;/P&gt;&lt;P&gt;…&lt;/P&gt;&lt;P&gt;KR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I create a data set where I still have the variable but all the observations are compressed in one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output:&lt;/P&gt;&lt;P&gt;County&lt;/P&gt;&lt;P&gt;BU, JA, US,...,KR&lt;/P&gt;</description>
    <pubDate>Fri, 08 Apr 2016 14:07:58 GMT</pubDate>
    <dc:creator>Sir_Highbury</dc:creator>
    <dc:date>2016-04-08T14:07:58Z</dc:date>
    <item>
      <title>Create a new data set concatenating the observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-data-set-concatenating-the-observations/m-p/262437#M51223</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let's assume there is the following data set with one variable (country) and severa observations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;country&lt;/P&gt;&lt;P&gt;BU&lt;/P&gt;&lt;P&gt;JA&lt;/P&gt;&lt;P&gt;US&lt;/P&gt;&lt;P&gt;…&lt;/P&gt;&lt;P&gt;KR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I create a data set where I still have the variable but all the observations are compressed in one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output:&lt;/P&gt;&lt;P&gt;County&lt;/P&gt;&lt;P&gt;BU, JA, US,...,KR&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 14:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-data-set-concatenating-the-observations/m-p/262437#M51223</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-04-08T14:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new data set concatenating the observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-data-set-concatenating-the-observations/m-p/262441#M51225</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use a retain cating each item onto one long varaible then output at the end:&lt;/P&gt;
&lt;PRE&gt;data have;
  country="BU"; output;
  country="JA"; output;
  country="US"; output;
run;
data want (drop=country rename=(tmp=country));
  length tmp $2000;
  set have end=last;
  retain tmp;
  tmp=catx(",",tmp,country);
  if last then output;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Apr 2016 14:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-data-set-concatenating-the-observations/m-p/262441#M51225</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-08T14:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new data set concatenating the observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-data-set-concatenating-the-observations/m-p/262468#M51248</link>
      <description>&lt;P&gt;many thanks&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 14:59:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-data-set-concatenating-the-observations/m-p/262468#M51248</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-04-08T14:59:20Z</dc:date>
    </item>
  </channel>
</rss>

