Help using Base SAS procedures

cumulative return for repeated indexing

Not applicable
Posts: 1

cumulative return for repeated indexing

Hello All,

I am working with a huge financial dataset (TAQ with 5 minutes intervals) and wanted to perform the following two steps but having hard time trying to:

1- My earlier program extracted transaction data for each stock then aggregated over five minutes interval, where each 5 minute interval is referenced by a number: 12:00-12:05 = 1 , 12:05-12:10 = 2 ..... etc. Now, if a 5-minute period doesn't have transactions it is skipped. I need to replace missing obs and put zeros, and that is to be performed during a certain period (period 115-170). Note that I have many stocks and dates. I tried the usual PROC EXPAND , method=none but I think the key thing is that my reference number that indicates the 5-minute periods is not datetime variable. Any suggestion?

2- I need to calculate cumulative return for 5 days for all stocks each stock has a column that describes the day by a number from 1-5 on a rolling basis.


Super Contributor
Posts: 320

Re: cumulative return for repeated indexing

For 1, just pretend your variable is a date variable.  Dates are integer numbers of days, anyway, so SAS won't know you don't have a date.  Or convert the periods to actual time variables - that wouldn't be terribly difficult, anyway.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation