<?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 Creating multiple rows from 1 record in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Creating-multiple-rows-from-1-record/m-p/54439#M15076</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a list of unique observations that I want to assign a month to for several years&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obs&lt;/P&gt;&lt;P&gt;1 &lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3 etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want it to look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obs&lt;/P&gt;&lt;P&gt;1 Jan05&lt;/P&gt;&lt;P&gt;1 Feb05&lt;/P&gt;&lt;P&gt;1 Mar05....&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;1 Jul11&lt;/P&gt;&lt;P&gt;2 Jan05&lt;/P&gt;&lt;P&gt;2 Feb05 and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help with the most efficient way of doing this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Aug 2011 09:02:03 GMT</pubDate>
    <dc:creator>uksusu</dc:creator>
    <dc:date>2011-08-25T09:02:03Z</dc:date>
    <item>
      <title>Creating multiple rows from 1 record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-multiple-rows-from-1-record/m-p/54439#M15076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a list of unique observations that I want to assign a month to for several years&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obs&lt;/P&gt;&lt;P&gt;1 &lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3 etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want it to look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obs&lt;/P&gt;&lt;P&gt;1 Jan05&lt;/P&gt;&lt;P&gt;1 Feb05&lt;/P&gt;&lt;P&gt;1 Mar05....&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;1 Jul11&lt;/P&gt;&lt;P&gt;2 Jan05&lt;/P&gt;&lt;P&gt;2 Feb05 and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help with the most efficient way of doing this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 09:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-multiple-rows-from-1-record/m-p/54439#M15076</guid>
      <dc:creator>uksusu</dc:creator>
      <dc:date>2011-08-25T09:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating multiple rows from 1 record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-multiple-rows-from-1-record/m-p/54440#M15077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DATA out(DROP=i);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;DO obs=1 TO 5;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;DO i=0 TO 4;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;date=INTNX('MONTH','01jan2005'd,i,'B');&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;OUTPUT;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;END;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;END;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FORMAT date ddmmyy10.; &lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 09:49:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-multiple-rows-from-1-record/m-p/54440#M15077</guid>
      <dc:creator>Jaheuk</dc:creator>
      <dc:date>2011-08-25T09:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating multiple rows from 1 record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-multiple-rows-from-1-record/m-p/54441#M15078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi, &lt;/P&gt;&lt;P&gt;In the following program you&amp;nbsp; need to set the start year and the end_year that you want to use: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;input obs;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%let start_year=2005;&lt;/P&gt;&lt;P&gt;%let end_year=2011;&lt;/P&gt;&lt;P&gt;options symbolgen;&lt;/P&gt;&lt;P&gt;data temp2(drop= j i);&lt;/P&gt;&lt;P&gt;set temp;&lt;/P&gt;&lt;P&gt;do i=&amp;amp;start_year to &amp;amp;end_year;&lt;/P&gt;&lt;P&gt; do j=1 to 12;&lt;/P&gt;&lt;P&gt; month=mdy(j,01,i);&lt;/P&gt;&lt;P&gt; output;&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;format month mmyyn6.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 12pt;"&gt;&lt;SPAN style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 12pt;"&gt;&lt;SPAN style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 12pt;"&gt;&lt;SPAN style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 09:58:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-multiple-rows-from-1-record/m-p/54441#M15078</guid>
      <dc:creator>yonib</dc:creator>
      <dc:date>2011-08-25T09:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Creating multiple rows from 1 record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-multiple-rows-from-1-record/m-p/54442#M15079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see that others have already shown you how to build a series of consecutive monthly periods, but I have what I think is an equally pressing question: how do you know which date applies to which of your records?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 13:39:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-multiple-rows-from-1-record/m-p/54442#M15079</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-25T13:39:40Z</dc:date>
    </item>
    <item>
      <title>Creating multiple rows from 1 record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-multiple-rows-from-1-record/m-p/54443#M15080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For all of my observations I needed to create an extra row for each month since Jan05 with the obs against it; so each observation would appear 79 times (number of months since Jan05).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have additional data at obs level but only appearing in certain months; but my customer wants to see all months even if the observation does not have a record against it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With my original data now I can do a simple merge by obs &amp;amp; date to keep all obs for all months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had actually created what I required before posting, but it seemed such a convoluted solution, that I thought there must be an easier way; and there was!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both options worked fine, but I went with the yonib's in the end. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to everyone who replied.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 14:49:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-multiple-rows-from-1-record/m-p/54443#M15080</guid>
      <dc:creator>uksusu</dc:creator>
      <dc:date>2011-08-25T14:49:16Z</dc:date>
    </item>
  </channel>
</rss>

