<?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: How to expand a SAS dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-expand-a-SAS-dataset/m-p/481288#M124462</link>
    <description>&lt;P&gt;That's it!&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jul 2018 21:56:28 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-07-25T21:56:28Z</dc:date>
    <item>
      <title>How to expand a SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-expand-a-SAS-dataset/m-p/481284#M124459</link>
      <description>&lt;P&gt;All,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;I am looking to understand how to expand a SAS dataset ? So, let us look at the following example&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Test; 
	set Sashelp.timedata(obs = 3); 
Run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; The above would yield the following :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 267px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22018i6352F705E57D0E1B/image-dimensions/267x111?v=v2" width="267" height="111" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Now, let us say i would like to define the values over the next 3 time intervals and I want something like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 165px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22021iC06CF7FCF5C83A65/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; In this example, volume has the relation of being 1.5 times of the previous rows and the the datetime is just uniform with 30 minute interval.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 21:40:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-expand-a-SAS-dataset/m-p/481284#M124459</guid>
      <dc:creator>UdayGuntupalli</dc:creator>
      <dc:date>2018-07-25T21:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand a SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-expand-a-SAS-dataset/m-p/481285#M124460</link>
      <description>&lt;P&gt;Well, I don't think your math is right regarding multiplying by 1.5 ... however in general this should work ... by adding 30*60 to the datatime, that's 30 minutes converted to seconds (by multiplying by 60).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test.
    set sashelp.timedata(obs=3) end=eof;
    output;
    if eof then do 1 = 1 to 3;
         volume=volume*1.5;
         datetime=datetime+30*60;
         output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Jul 2018 21:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-expand-a-SAS-dataset/m-p/481285#M124460</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-25T21:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand a SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-expand-a-SAS-dataset/m-p/481286#M124461</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Thank you. When I dragged the formula over in Excel for the screenshot, I believe it got incremented. However, I get the idea of what you are proposing. I noticed a few errors in the code you provided:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test; * This i believe is not a period and a semicolon; 
    set sashelp.timedata(obs=3) end=eof;
    output;
    if eof then do i = 1 to 3;   *I don't think this is 1 = 1 to 3 but i = 1 to 3; 
         volume=volume*1.5;
         datetime=datetime+30*60;
         output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Assuming this is what you were recommending, it works.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 21:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-expand-a-SAS-dataset/m-p/481286#M124461</guid>
      <dc:creator>UdayGuntupalli</dc:creator>
      <dc:date>2018-07-25T21:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand a SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-expand-a-SAS-dataset/m-p/481288#M124462</link>
      <description>&lt;P&gt;That's it!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 21:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-expand-a-SAS-dataset/m-p/481288#M124462</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-25T21:56:28Z</dc:date>
    </item>
  </channel>
</rss>

