<?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: Collapse multiple records into one and combine column values in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Collapse-multiple-records-into-one-and-combine-column-values/m-p/247551#M56310</link>
    <description>&lt;P&gt;Thanks a lot Freelance! That did it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not used Proc Summary before. What do the below aspects of it do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(drop=_:) max=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2016 18:00:21 GMT</pubDate>
    <dc:creator>Paul_NYS</dc:creator>
    <dc:date>2016-02-02T18:00:21Z</dc:date>
    <item>
      <title>Collapse multiple records into one and combine column values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Collapse-multiple-records-into-one-and-combine-column-values/m-p/247545#M56308</link>
      <description>&lt;P&gt;Hi Everyone&lt;/P&gt;&lt;P&gt;I would like to collapse the below records (screenshot) that have the same entity_id&amp;nbsp; into one record and keep all the column values, where one is populated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a fairly straight forward way of doing this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1717i14BBD79078F7F3C2/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="collapserecords.PNG" title="collapserecords.PNG" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 17:36:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Collapse-multiple-records-into-one-and-combine-column-values/m-p/247545#M56308</guid>
      <dc:creator>Paul_NYS</dc:creator>
      <dc:date>2016-02-02T17:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse multiple records into one and combine column values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Collapse-multiple-records-into-one-and-combine-column-values/m-p/247549#M56309</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
class entity_id;
var SubPh:;
output out=want(drop=_:) max=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Feb 2016 17:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Collapse-multiple-records-into-one-and-combine-column-values/m-p/247549#M56309</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-02T17:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse multiple records into one and combine column values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Collapse-multiple-records-into-one-and-combine-column-values/m-p/247551#M56310</link>
      <description>&lt;P&gt;Thanks a lot Freelance! That did it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not used Proc Summary before. What do the below aspects of it do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(drop=_:) max=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 18:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Collapse-multiple-records-into-one-and-combine-column-values/m-p/247551#M56310</guid>
      <dc:creator>Paul_NYS</dc:creator>
      <dc:date>2016-02-02T18:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse multiple records into one and combine column values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Collapse-multiple-records-into-one-and-combine-column-values/m-p/247555#M56312</link>
      <description>&lt;P&gt;Glad to&amp;nbsp;read that it worked for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you have used (or heard of) PROC MEANS? It's almost the same, but writes to the output window by default.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The option MAX= of the OUTPUT statement says that&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;for each analysis variable specified in the VAR statement* the maximum is the summary statistic to be computed.&lt;/LI&gt;
&lt;LI&gt;The names of the variables in the output dataset (here: WANT) containing the summary statistics shall be the names of the corresponding analysis variables (i.e., the maximum of SubPh1 shall&amp;nbsp;be stored in a variable SubPh1, etc.). Otherwise, the new names would need to be listed after "MAX=".&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;By default, the output dataset contains variables _TYPE_ and _FREQ_ containing additional information about the summary: In your example, _TYPE_=1 for all observations, hence not very interesting, _FREQ_ = number of observations summarized, i.e. 3 for entity_id=165771, 5 for entity_id=230674, ... Assuming that you don't need these variables, I dropped them. More precisely: I dropped all variables whose names start with an underscore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* Here, the VAR statement contains the list of all variables in dataset HAVE whose names start with "SubPh" (assuming that these are exactly your intended analysis variables).&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 18:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Collapse-multiple-records-into-one-and-combine-column-values/m-p/247555#M56312</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-02T18:21:24Z</dc:date>
    </item>
  </channel>
</rss>

