<?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: how to join observations into one string? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-join-observations-into-one-string/m-p/432159#M106991</link>
    <description>&lt;P&gt;s_lassen has the right approach.&amp;nbsp; To get the first id you can simply set a variable with the value and retain it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data d;
	length a 8 b $3;
	infile cards;
	input a b $;
cards;
1  abc
2  def
3  ghi
4  jkl
run;

data b;
	length n1 8 n2 $32760;
	set d end=eof;
	retain n1 n2;
	if _n_ = 1 then n1 = a;
	call cats(n2,b);
	keep n1 n2;
	if eof then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 30 Jan 2018 12:31:09 GMT</pubDate>
    <dc:creator>foobarbaz</dc:creator>
    <dc:date>2018-01-30T12:31:09Z</dc:date>
    <item>
      <title>how to join observations into one string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-join-observations-into-one-string/m-p/432143#M106981</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a dataset like this (obviously i have more than 4 rows though),&lt;/P&gt;&lt;P&gt;1&amp;nbsp; abc&lt;/P&gt;&lt;P&gt;2&amp;nbsp; def&lt;/P&gt;&lt;P&gt;3&amp;nbsp; ghi&lt;/P&gt;&lt;P&gt;4&amp;nbsp; jkl&lt;/P&gt;&lt;P&gt;I want to turn it into&lt;/P&gt;&lt;P&gt;1&amp;nbsp; abcdefghijkl&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using a put function but for some reason i end up with&amp;nbsp;&lt;/P&gt;&lt;P&gt;abc&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/P&gt;&lt;P&gt;def&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;&lt;P&gt;ghi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/P&gt;&lt;P&gt;jkl&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is still a string, but just each row is now a paragraph instead, with a weird dot to show the row's end. I would like to remove that and just have the content of the variable from each row to concatenate and become one whole string. Also the data is alphanumeric as it wouldve been A-Z1-100.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone has any idea please help.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 11:58:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-join-observations-into-one-string/m-p/432143#M106981</guid>
      <dc:creator>AlexMoreton</dc:creator>
      <dc:date>2018-01-30T11:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to join observations into one string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-join-observations-into-one-string/m-p/432157#M106990</link>
      <description>&lt;P&gt;I would use CALL CATS, which appends the second parameter (stripped of blanks) to the first variable:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  length longstring $5000;
  retain longstring;
  call cats(longstring,string);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jan 2018 12:26:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-join-observations-into-one-string/m-p/432157#M106990</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2018-01-30T12:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to join observations into one string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-join-observations-into-one-string/m-p/432159#M106991</link>
      <description>&lt;P&gt;s_lassen has the right approach.&amp;nbsp; To get the first id you can simply set a variable with the value and retain it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data d;
	length a 8 b $3;
	infile cards;
	input a b $;
cards;
1  abc
2  def
3  ghi
4  jkl
run;

data b;
	length n1 8 n2 $32760;
	set d end=eof;
	retain n1 n2;
	if _n_ = 1 then n1 = a;
	call cats(n2,b);
	keep n1 n2;
	if eof then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jan 2018 12:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-join-observations-into-one-string/m-p/432159#M106991</guid>
      <dc:creator>foobarbaz</dc:creator>
      <dc:date>2018-01-30T12:31:09Z</dc:date>
    </item>
  </channel>
</rss>

