<?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 Combining character variable into group of variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Combining-character-variable-into-group-of-variables/m-p/457419#M115974</link>
    <description>&lt;P&gt;I have a data set having a single column of names and 100 rows .&lt;/P&gt;
&lt;P&gt;Is there way to combine names from every 10 rows into a string?&lt;/P&gt;
&lt;P&gt;For example my data may be like this&lt;/P&gt;
&lt;P&gt;aaaa&lt;/P&gt;
&lt;P&gt;bbbb&lt;/P&gt;
&lt;P&gt;abbc&lt;/P&gt;
&lt;P&gt;ddda&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;What I want ot get is a new table with&lt;/P&gt;
&lt;P&gt;aaaa bbbb abbbc&lt;/P&gt;
&lt;P&gt;ddda efgh ijkl lmnop&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;
&lt;P&gt;Is there a way to do it?&lt;/P&gt;</description>
    <pubDate>Wed, 25 Apr 2018 17:46:29 GMT</pubDate>
    <dc:creator>thesasuser</dc:creator>
    <dc:date>2018-04-25T17:46:29Z</dc:date>
    <item>
      <title>Combining character variable into group of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-character-variable-into-group-of-variables/m-p/457419#M115974</link>
      <description>&lt;P&gt;I have a data set having a single column of names and 100 rows .&lt;/P&gt;
&lt;P&gt;Is there way to combine names from every 10 rows into a string?&lt;/P&gt;
&lt;P&gt;For example my data may be like this&lt;/P&gt;
&lt;P&gt;aaaa&lt;/P&gt;
&lt;P&gt;bbbb&lt;/P&gt;
&lt;P&gt;abbc&lt;/P&gt;
&lt;P&gt;ddda&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;What I want ot get is a new table with&lt;/P&gt;
&lt;P&gt;aaaa bbbb abbbc&lt;/P&gt;
&lt;P&gt;ddda efgh ijkl lmnop&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;
&lt;P&gt;Is there a way to do it?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 17:46:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-character-variable-into-group-of-variables/m-p/457419#M115974</guid>
      <dc:creator>thesasuser</dc:creator>
      <dc:date>2018-04-25T17:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Combining character variable into group of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-character-variable-into-group-of-variables/m-p/457425#M115977</link>
      <description>&lt;P&gt;First group the data by 10 records each and then use proc transpose by the grouped variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA have(drop=i);
do i=1 to 200;
val=put(i,3.);
output;
end;
run;
data want;
retain group;
set have;
IF _N_=1 then group=1;
else if MOD(_N_-1,10)=0 then group+1;
run;

proc transpose data=want out=want1;
by group;
var val;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Apr 2018 17:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-character-variable-into-group-of-variables/m-p/457425#M115977</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-04-25T17:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Combining character variable into group of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-character-variable-into-group-of-variables/m-p/457428#M115979</link>
      <description>&lt;P&gt;It's probably a bad idea that will only make your life harder down the road.&amp;nbsp; But it's not difficult:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;length string $ 200;&lt;/P&gt;
&lt;P&gt;do _n_=1 to 10 until (done);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set have end=done;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; string = catx(' ', string, name);&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;drop name;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 18:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-character-variable-into-group-of-variables/m-p/457428#M115979</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-25T18:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Combining character variable into group of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-character-variable-into-group-of-variables/m-p/457447#M115983</link>
      <description>Thanks&lt;BR /&gt;Both solutions are wonderful and good.&lt;BR /&gt;Accepted this as simpler code</description>
      <pubDate>Wed, 25 Apr 2018 18:47:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-character-variable-into-group-of-variables/m-p/457447#M115983</guid>
      <dc:creator>thesasuser</dc:creator>
      <dc:date>2018-04-25T18:47:14Z</dc:date>
    </item>
  </channel>
</rss>

