<?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 Cumulative returns per porfolio in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Cumulative-returns-per-porfolio/m-p/20083#M4157</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am still not sure I have completely understand what you want. I thought my solution could do what you just asked. if you could just post several line of data to show what your wanted table look like, that would definitely help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Mar 2012 15:39:03 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2012-03-03T15:39:03Z</dc:date>
    <item>
      <title>Cumulative returns per porfolio</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Cumulative-returns-per-porfolio/m-p/20080#M4154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sas members,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two stocks per portfolio which I randomly selected.Each stock stays three days in the portfolio and have returns per day. Then the stocks are sold and are invested in the new portfolio.&lt;/P&gt;&lt;P&gt;So I have trouble in porgramming the following;&lt;/P&gt;&lt;P&gt;1) for every portfolio I have to calculate the cumulative return per stock (ok, works for me)&lt;/P&gt;&lt;P&gt;2) At the end of the portfolio (day 3) the stocks are sold and I have to sum the cumulative returns, divide it by two and reinvest it equally in the next two stocks of portfolio 2, and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have difficulties implementing step 2...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have uploaded sample data in the attachement;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is my code for step 1&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;/SPAN&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;P&gt;&lt;SPAN style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&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;/SPAN&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;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;/SPAN&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;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="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;/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;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;/SPAN&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;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;STRONG&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 12pt;"&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;proc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;sort&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Courier New;"&gt;=WORK.QUERY_FOR_RETURNS &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;out&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Courier New;"&gt;=RENDER;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-family: Courier New; color: #0000ff; font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&lt;P&gt;by&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;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Courier New;"&gt;PORT STOCK DATE;&lt;/SPAN&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;STRONG&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 12pt;"&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;P&gt;run&lt;/P&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&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;STRONG&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 12pt;"&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;P&gt;data&lt;/P&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Courier New;"&gt;POD_100;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-family: Courier New; color: #0000ff; font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&lt;P&gt;set&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;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Courier New;"&gt;RENDER;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-family: Courier New; color: #0000ff; font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&lt;P&gt;by&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;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="color: #000000;"&gt;PORT STOCK;&lt;/SPAN&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="color: #008000; font-size: 12pt; font-family: Courier New;"&gt;&lt;P&gt;*Calculating the retunr per stock in the portfolio;&lt;/P&gt;&lt;/SPAN&gt;&lt;SPAN style="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 style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; first.stock &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;do&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&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="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; ret=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt;.&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; cumret=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&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="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;end&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&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="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; ret NE &lt;/SPAN&gt;&lt;STRONG style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt;.&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;do&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;cumret=cumret*ret+cumret;&lt;/P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&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;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;end&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&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;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;retain&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;cumret;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&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&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;STRONG&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 12pt;"&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&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;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="mcePaste" id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 0px; left: -10000px;"&gt;﻿&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 13:50:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Cumulative-returns-per-porfolio/m-p/20080#M4154</guid>
      <dc:creator>OzoneX15</dc:creator>
      <dc:date>2012-03-02T13:50:40Z</dc:date>
    </item>
    <item>
      <title>Cumulative returns per porfolio</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Cumulative-returns-per-porfolio/m-p/20081#M4155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not 100% sure about what you asked for. Here just to start discussion, if you are after the initial investment for each company:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want (drop=_: cumret);&lt;/P&gt;&lt;P&gt;do until (last.port);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by port stock date;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if first.port then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _d=_c;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _c=0;&lt;/P&gt;&lt;P&gt; invest=_d/2;&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if first.stock then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cumret=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; cumret+cumret*ret;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if last.stock then _c+cumret;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;end;&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;Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 18:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Cumulative-returns-per-porfolio/m-p/20081#M4155</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-02T18:55:35Z</dc:date>
    </item>
    <item>
      <title>Cumulative returns per porfolio</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Cumulative-returns-per-porfolio/m-p/20082#M4156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i should have the cumulative return of each stock in portfolio 1. After portfolio 1 the cumulative return of the stocks should be taken (summed/2) and invested against the returns of the stocks of portfolio 2 and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefaan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 14:30:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Cumulative-returns-per-porfolio/m-p/20082#M4156</guid>
      <dc:creator>OzoneX15</dc:creator>
      <dc:date>2012-03-03T14:30:41Z</dc:date>
    </item>
    <item>
      <title>Cumulative returns per porfolio</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Cumulative-returns-per-porfolio/m-p/20083#M4157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am still not sure I have completely understand what you want. I thought my solution could do what you just asked. if you could just post several line of data to show what your wanted table look like, that would definitely help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 15:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Cumulative-returns-per-porfolio/m-p/20083#M4157</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-03T15:39:03Z</dc:date>
    </item>
  </channel>
</rss>

