Hi Rick, I am so grateful for your prompt response to my post. The code you provided is so clear and make much more sense to me in terms of its structure and enhances my understanding of how SAS/IML works. I will try adding the loop by group feature to the code you suggested and see how it goes. By the way, I just noted that the dataset SASHELP.STOCKS needs to be sorted by "Date" for each stock before the proc iml procedure can be implemented so the results obtained are for 'historical' rather than "forward-looking" rolling windows. Thank you very much again.
... View more