<?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 combine multiple observations into one single observation without having the group var ke in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682011#M206402</link>
    <description>&lt;P&gt;your code working great with the concept of hold values into one final variable. But my requirement is to club obs into one obs and bring all obs values into one obs value with space with respect to the columns.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached a sheet with the expected result Kindly help on this.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Sep 2020 13:19:05 GMT</pubDate>
    <dc:creator>veeresh10</dc:creator>
    <dc:date>2020-09-07T13:19:05Z</dc:date>
    <item>
      <title>How to combine multiple observations into one single observation without having the group var key.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682000#M206395</link>
      <description>&lt;P&gt;Need to combine more than 10 obs data into one observation.&lt;/P&gt;&lt;P&gt;problem is we not have any key to hold as group var.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have more then&amp;nbsp;&lt;/P&gt;&lt;P&gt;24 var s&lt;/P&gt;&lt;P&gt;a b c d e f g t h i ...... aa ab ac ad&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;need to combine multiple observations into one observation.&lt;/P&gt;&lt;P&gt;ex- dataset contains 20 or more variables and 10 to 15 observations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;so all observations combine it into one single observation.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Sep 2020 11:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682000#M206395</guid>
      <dc:creator>veeresh10</dc:creator>
      <dc:date>2020-09-07T11:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine multiple observations into one single observation without having the group var ke</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682001#M206396</link>
      <description>&lt;P&gt;What should that single observation contain? Show us some representable sample of your data please.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Sep 2020 11:48:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682001#M206396</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-09-07T11:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine multiple observations into one single observation without having the group var ke</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682005#M206399</link>
      <description>&lt;P&gt;All variables are character variables and contain data with a max length of 50.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Sep 2020 11:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682005#M206399</guid>
      <dc:creator>veeresh10</dc:creator>
      <dc:date>2020-09-07T11:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine multiple observations into one single observation without having the group var ke</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682008#M206400</link>
      <description>&lt;P&gt;If you want all text in one long variable compressed to single space between words in the order of the input lines than try next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mytxt xlsx "&amp;lt;path and name of file&amp;gt;.xlsx";
data have;
 set mytxt.&amp;lt;sheet_name&amp;gt;;
run;

%let cols = 50; /* adapt to max columns read */
data want(keep=wanted);
   length wanted $10000; /* adapt to max length needed */
   retain wanted ;
   set have end=eof;
        array all {*} $ _ALL_; 
        do i=1 to dim(all);&lt;BR /&gt;           if not missing(all(i)) then&lt;BR /&gt;              all(i) = compbl(all(i));
           wanted = cats(wanted, all(i));
        end;
        if eof then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Sep 2020 12:42:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682008#M206400</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-09-07T12:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine multiple observations into one single observation without having the group var ke</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682011#M206402</link>
      <description>&lt;P&gt;your code working great with the concept of hold values into one final variable. But my requirement is to club obs into one obs and bring all obs values into one obs value with space with respect to the columns.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached a sheet with the expected result Kindly help on this.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Sep 2020 13:19:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682011#M206402</guid>
      <dc:creator>veeresh10</dc:creator>
      <dc:date>2020-09-07T13:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine multiple observations into one single observation without having the group var ke</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682015#M206406</link>
      <description>&lt;P&gt;I see, you want to concatenate all text of the same column, so finally the output will contain all the variables as in the input:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let cols = 50; /* adapt to max columns read */
data want;
 set have end=eof;
       length txtout1-txtou&amp;amp;cols $80;  /* adapt to max length needed per column */
       array colin {*} $ col1-col&amp;amp;cols;
       array txtout {*} $ txtout1-txtou&amp;amp;cols;
       do i=1 to &amp;amp;cols;
            txtout(i) = cats(txtout(i), colin(i));
       end;
       if eof then output;
      keep txtout1-txtou&amp;amp;cols ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Sep 2020 13:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-multiple-observations-into-one-single-observation/m-p/682015#M206406</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-09-07T13:34:44Z</dc:date>
    </item>
  </channel>
</rss>

