<?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: converting mutliple observations to 1 record of distinct data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/converting-mutliple-observations-to-1-record-of-distinct-data/m-p/372505#M276087</link>
    <description>&lt;P&gt;Alternatively&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have out=temp nodupkey;
  by account id;
run;

proc transpose data=have out=trans;
by account;
var id;
run;

data want;
set trans;
new_id=catx(',',of col:);
drop col: _name_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 02 Jul 2017 06:36:17 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2017-07-02T06:36:17Z</dc:date>
    <item>
      <title>converting mutliple observations to 1 record of distinct data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-mutliple-observations-to-1-record-of-distinct-data/m-p/372495#M276085</link>
      <description>&lt;P&gt;Hi I have data some thing like below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;account&lt;/TD&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;94345&lt;/TD&gt;&lt;TD&gt;42&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;94345&lt;/TD&gt;&lt;TD&gt;26&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;94345&lt;/TD&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;94345&lt;/TD&gt;&lt;TD&gt;34&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;94345&lt;/TD&gt;&lt;TD&gt;42&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;94345&lt;/TD&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i want something like this with distinct data in the id field after concatenating,Can any one help me with this !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;account&lt;/TD&gt;&lt;TD&gt;new id&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;94345&lt;/TD&gt;&lt;TD&gt;42,26,18,34&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 03:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-mutliple-observations-to-1-record-of-distinct-data/m-p/372495#M276085</guid>
      <dc:creator>Deepti44</dc:creator>
      <dc:date>2017-07-02T03:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: converting mutliple observations to 1 record of distinct data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-mutliple-observations-to-1-record-of-distinct-data/m-p/372501#M276086</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have out=temp nodupkey;
  by account id;
run;

data want;
  set temp;
   by account;
        length new_id $100;  /* addapt to max length needed */
        retain new_id;
        if first.account then new_id = ' ';
        new_id = catx(',',new_id,id);
        if last.account then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 02 Jul 2017 04:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-mutliple-observations-to-1-record-of-distinct-data/m-p/372501#M276086</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-02T04:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: converting mutliple observations to 1 record of distinct data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-mutliple-observations-to-1-record-of-distinct-data/m-p/372505#M276087</link>
      <description>&lt;P&gt;Alternatively&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have out=temp nodupkey;
  by account id;
run;

proc transpose data=have out=trans;
by account;
var id;
run;

data want;
set trans;
new_id=catx(',',of col:);
drop col: _name_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 02 Jul 2017 06:36:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-mutliple-observations-to-1-record-of-distinct-data/m-p/372505#M276087</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-07-02T06:36:17Z</dc:date>
    </item>
  </channel>
</rss>

