<?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 Partially combine multiple rows to a single row in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Partially-combine-multiple-rows-to-a-single-row/m-p/587377#M167766</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty new to this community but reaching out for help to unravel the difficulty I am having.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sample data set is....&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input ID epi_1 : mmddyy10. epi_2 : mmddyy10. epi_3 : mmddyy10. ;
	format epi_1 mmddyy10. epi_2 mmddyy10. epi_3 mmddyy10.;
	datalines;
	1 01/01/2019 02/01/2019 .
	1 03/01/2019 .          .
	2 04/01/2019 .          .
	2 05/01/2019 .          .
	2 06/01/2019 07/01/2019 .
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am trying to transpose the data set by ID but I only want to keep non missing columns and change the column name in sequence (the column name of the first episode should be epi_1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the data set I want to output:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 366px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32328i2EA48A7C6329272F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions are welcome! Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2019 21:52:35 GMT</pubDate>
    <dc:creator>_MooMoo</dc:creator>
    <dc:date>2019-09-09T21:52:35Z</dc:date>
    <item>
      <title>Partially combine multiple rows to a single row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Partially-combine-multiple-rows-to-a-single-row/m-p/587377#M167766</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty new to this community but reaching out for help to unravel the difficulty I am having.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sample data set is....&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input ID epi_1 : mmddyy10. epi_2 : mmddyy10. epi_3 : mmddyy10. ;
	format epi_1 mmddyy10. epi_2 mmddyy10. epi_3 mmddyy10.;
	datalines;
	1 01/01/2019 02/01/2019 .
	1 03/01/2019 .          .
	2 04/01/2019 .          .
	2 05/01/2019 .          .
	2 06/01/2019 07/01/2019 .
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am trying to transpose the data set by ID but I only want to keep non missing columns and change the column name in sequence (the column name of the first episode should be epi_1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the data set I want to output:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 366px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32328i2EA48A7C6329272F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions are welcome! Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 21:52:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Partially-combine-multiple-rows-to-a-single-row/m-p/587377#M167766</guid>
      <dc:creator>_MooMoo</dc:creator>
      <dc:date>2019-09-09T21:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Partially combine multiple rows to a single row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Partially-combine-multiple-rows-to-a-single-row/m-p/587387#M167770</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/289227"&gt;@_MooMoo&lt;/a&gt;&amp;nbsp; Welcome to SAS communities as it's your 1st post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See if this helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input ID epi_1 : mmddyy10. epi_2 : mmddyy10. epi_3 : mmddyy10. ;
	format epi_1 mmddyy10. epi_2 mmddyy10. epi_3 mmddyy10.;
	datalines;
	1 01/01/2019 02/01/2019 .
	1 03/01/2019 .          .
	2 04/01/2019 .          .
	2 05/01/2019 .          .
	2 06/01/2019 07/01/2019 .
;
run;

proc transpose data=have out=t(where=(col1 ne .) keep=id col1);
by id ep:;
var ep:	;
run;

proc transpose data=t out=want(drop=_:) prefix=Ep_;
by id ;
var col1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Kind Regards!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 00:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Partially-combine-multiple-rows-to-a-single-row/m-p/587387#M167770</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-10T00:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Partially combine multiple rows to a single row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Partially-combine-multiple-rows-to-a-single-row/m-p/587519#M167825</link>
      <description>Thanks! Didn't think this way.</description>
      <pubDate>Tue, 10 Sep 2019 13:57:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Partially-combine-multiple-rows-to-a-single-row/m-p/587519#M167825</guid>
      <dc:creator>_MooMoo</dc:creator>
      <dc:date>2019-09-10T13:57:23Z</dc:date>
    </item>
  </channel>
</rss>

