<?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 can I get a month or year return starting at a certain date? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573326#M161845</link>
    <description>Just to confirm then ...&lt;BR /&gt;&lt;BR /&gt;For a starting date of Jan 28, 29, 30, or 31, the ending date will be Feb 28?</description>
    <pubDate>Sat, 13 Jul 2019 22:35:40 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-07-13T22:35:40Z</dc:date>
    <item>
      <title>How can I get a month or year return starting at a certain date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573320#M161840</link>
      <description>&lt;P&gt;HI!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a very close answer here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://wrds-www.wharton.upenn.edu/pages/support/applications/event-studies/event-study-research-application/" target="_blank"&gt;https://wrds-www.wharton.upenn.edu/pages/support/applications/event-studies/event-study-research-application/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But still... I wonder how can I get a monthly return from a specific date.&lt;/P&gt;&lt;P&gt;e.g. from July 13th to Aug 13.&lt;/P&gt;&lt;P&gt;If either or both dates are nontrading days, then select the next trading days. Since I have to have a month interval, the code used in the link that can only sets intervals instead of a certain period of time(like month and year) is not the right one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder how other CRSP users can get stock returns too.&lt;/P&gt;&lt;P&gt;If you use CRSP and know how to get month-long returns please share your knowledge.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2019 21:36:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573320#M161840</guid>
      <dc:creator>JKCho</dc:creator>
      <dc:date>2019-07-13T21:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get a month or year return starting at a certain date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573326#M161845</link>
      <description>Just to confirm then ...&lt;BR /&gt;&lt;BR /&gt;For a starting date of Jan 28, 29, 30, or 31, the ending date will be Feb 28?</description>
      <pubDate>Sat, 13 Jul 2019 22:35:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573326#M161845</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-07-13T22:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get a month or year return starting at a certain date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573336#M161849</link>
      <description>February can be either ending in 28th or 29th depending on the data. Still wondering I can make this kind of code. My intention is simple.&lt;BR /&gt;&lt;BR /&gt;I want to know return a month later. But it is depending on the data(trading days) whether the date a month later is a trading day or not. If not, the date will be the next trading day.</description>
      <pubDate>Sun, 14 Jul 2019 03:15:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573336#M161849</guid>
      <dc:creator>JKCho</dc:creator>
      <dc:date>2019-07-14T03:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get a month or year return starting at a certain date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573337#M161850</link>
      <description>I rather write another post so that you may understand better what I want to do. Thx though</description>
      <pubDate>Sun, 14 Jul 2019 03:48:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573337#M161850</guid>
      <dc:creator>JKCho</dc:creator>
      <dc:date>2019-07-14T03:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get a month or year return starting at a certain date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573710#M162020</link>
      <description>&lt;P&gt;The first part will be starting with actual SAS date values. Do you have that yet?&lt;/P&gt;
&lt;P&gt;I think that you want the INTNX function with the 'Same' option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
   do date='25Jan2020'd to '31JAN2020'd;
      newdate = intnx('month',date,1,'S');
      output;
   end;
   format date newdate date9.;
run;&lt;/PRE&gt;
&lt;P&gt;I used dates from 2020 as it is a leap year. 29, 30 and 31 Jan all get advanced to 29 Feb.&lt;/P&gt;
&lt;P&gt;If you use 2019 then 28, 29, 30 and 31 Jan all get advanced to 28 Feb.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 22:20:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573710#M162020</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-15T22:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get a month or year return starting at a certain date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573719#M162022</link>
      <description>Awwwwwwwwwwwwwwwwwwesome!&lt;BR /&gt;That is what I want!!&lt;BR /&gt;THX X 10000000000!!!!</description>
      <pubDate>Tue, 16 Jul 2019 00:36:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-get-a-month-or-year-return-starting-at-a-certain-date/m-p/573719#M162022</guid>
      <dc:creator>JKCho</dc:creator>
      <dc:date>2019-07-16T00:36:58Z</dc:date>
    </item>
  </channel>
</rss>

