BookmarkSubscribeRSS Feed
ahmadauh
Calcite | Level 5

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.

Thanks

1 REPLY 1
snoopy369
Barite | Level 11

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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1043 views
  • 0 likes
  • 2 in conversation