To get sum of squares in PROC IML, you can use the ## subscript reduction operator.
ssq=y(##,); /* sum of squares down the columns */
ssq2=y(,##); /* sum of squares across the rows */
Of course, to use this in your formula, you would have to subtract off the mean first. I assume you can do that yourself.
For all of these types of sum of squares formulas, there is also an expanded formula that is equivalent and allows a different computation that doesn't specifically involved subtracting off the mean.
--
Paige Miller