<?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: Concatenate if same month in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-if-same-month/m-p/345425#M79467</link>
    <description>&lt;P&gt;thank you! that worked perfectly!!&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2017 15:44:59 GMT</pubDate>
    <dc:creator>malena</dc:creator>
    <dc:date>2017-03-29T15:44:59Z</dc:date>
    <item>
      <title>Concatenate if same month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-if-same-month/m-p/345214#M79386</link>
      <description>I have a dataset with id, release_dare, and a a variable called datenum&lt;BR /&gt;&lt;BR /&gt;Id $4&lt;BR /&gt;release_date mmddyy.&lt;BR /&gt;Datenum $4&lt;BR /&gt;&lt;BR /&gt;There are several rows per id since each can have many release dates.  &lt;BR /&gt;&lt;BR /&gt;I want to create a one row per person with the following:&lt;BR /&gt;&lt;BR /&gt;Id, month1-month24 that each contains the datenum variable for the corresponding month of the release from release_date. If there sre 2 or more on the same month, concatenate the datenum.&lt;BR /&gt;&lt;BR /&gt;So if i have this as input:&lt;BR /&gt;&lt;BR /&gt;Id,   Release_date,     Datenum&lt;BR /&gt;1,    03/02/11,              1245&lt;BR /&gt;2,    01/01/11,              3423&lt;BR /&gt;2,   01/10/11,             5432&lt;BR /&gt;&lt;BR /&gt;At the end, i want this&lt;BR /&gt;&lt;BR /&gt;Id, month1, month2, month 3......month24 &lt;BR /&gt;1,     ,       ,  1245, .......&lt;BR /&gt;2,   34235432,   ,.....</description>
      <pubDate>Wed, 29 Mar 2017 01:13:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-if-same-month/m-p/345214#M79386</guid>
      <dc:creator>malena</dc:creator>
      <dc:date>2017-03-29T01:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate if same month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-if-same-month/m-p/345234#M79392</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
input ID RELEASE_DATE mmddyy8. DATENUM   ;
cards;
1 03/02/11 1245
2 01/01/11 3423
2 01/10/11 5432
run;
data WANT;
  set HAVE;
  by ID ;
  array MONTH[24] $32;
  retain MONTH1-MONTH24;
  INDEX=intck('month','01dec2010'd,RELEASE_DATE);
  MONTH[INDEX]=catt(MONTH[INDEX],DATENUM);
  if last.ID then do;
    output;
    call missing(of MONTH{*]);
  end;
run;
proc print noobs;
  var ID MONTH1-MONTH3;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS Output&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.WANT" frame="box" rules="all" cellpadding="5" cellspacing="0"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;ID&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;MONTH1&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;MONTH2&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;MONTH3&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;1245&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;TD class="l data"&gt;34235432&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 02:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-if-same-month/m-p/345234#M79392</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-03-29T02:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate if same month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-if-same-month/m-p/345238#M79393</link>
      <description>&lt;P&gt;If you need it for a report use proc tabulate.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 02:52:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-if-same-month/m-p/345238#M79393</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-29T02:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate if same month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-if-same-month/m-p/345425#M79467</link>
      <description>&lt;P&gt;thank you! that worked perfectly!!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 15:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-if-same-month/m-p/345425#M79467</guid>
      <dc:creator>malena</dc:creator>
      <dc:date>2017-03-29T15:44:59Z</dc:date>
    </item>
  </channel>
</rss>

