<?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 Expand a dataset by a specific amount in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Expand-a-dataset-by-a-specific-amount/m-p/217775#M40125</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be a bit of a complex task but I was wondering if there's a solution for the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset that has a "quantity" variable. I would like to expand each observation in this dataset by its quantity. For example, if row 1 has a quantity = 10, I would like to duplicate this row 10 times, and so forth. Can anyone suggest an efficient method for doing so?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 May 2015 20:43:27 GMT</pubDate>
    <dc:creator>bsam17</dc:creator>
    <dc:date>2015-05-20T20:43:27Z</dc:date>
    <item>
      <title>Expand a dataset by a specific amount</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expand-a-dataset-by-a-specific-amount/m-p/217775#M40125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be a bit of a complex task but I was wondering if there's a solution for the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset that has a "quantity" variable. I would like to expand each observation in this dataset by its quantity. For example, if row 1 has a quantity = 10, I would like to duplicate this row 10 times, and so forth. Can anyone suggest an efficient method for doing so?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 20:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expand-a-dataset-by-a-specific-amount/m-p/217775#M40125</guid>
      <dc:creator>bsam17</dc:creator>
      <dc:date>2015-05-20T20:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Expand a dataset by a specific amount</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expand-a-dataset-by-a-specific-amount/m-p/217776#M40126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do _i_=1 to quantity;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; drop _i_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might also want to consider what should happen for unusual values for QUANTITY (negative numbers, fractional values, missing values).&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 12:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expand-a-dataset-by-a-specific-amount/m-p/217776#M40126</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-05-21T12:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Expand a dataset by a specific amount</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expand-a-dataset-by-a-specific-amount/m-p/217777#M40127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2015 17:03:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expand-a-dataset-by-a-specific-amount/m-p/217777#M40127</guid>
      <dc:creator>bsam17</dc:creator>
      <dc:date>2015-06-05T17:03:35Z</dc:date>
    </item>
  </channel>
</rss>

