HI! I think I need different codes for 1)holding period return and 2)monthly, yearly return, or similar. holding period return is tricky because I need to use days from a certain date to another certain date. In other words, I cannot simply make code someday+1's price and divide a previous day by the next day. For exmaple, from July 12th, 2019, one-day HPR needs the next business day, July 15th, 2019. So... To calculate one-day holding period return, I may need a new code other than day+1. I guess there should the code navigating adding or subtracting days by the order of rows on certain variables. (For example, if the interval is +- 1 business days, that would be July 11st and July 15th, 2019 as my CRSP daily data has the price row following business days) So far, I have looked for the code having date interval specified by the order of rows of interest. Please share your knowledge... Maybe my ability to search for the answer is so poor... Another question is also related to the above question. If I need to know a month return from June 7th, 2019 to July 7th, 2019, I need to have stock prices on both dates. Well... 2019/07/07 is Sunday so I need next day, Monday. In that case, I need another code that automatically finds the next available date on my dataset. I think this is quite an advanced SAS programming. Maybe the gist of those coding is how to skillfully use the order of rows and I even wonder whether this is possible. There is almost no way to express my thankfulness to you have helped me other than writing here. However, I would like to thank you again for your helpful replies very much!!!! Jerry
... View more