In reply to Jon Dickens.

You can solve for the optimal value of a function by using the Nonlinear Programming (NLP) functions in SAS/IML. I've written several blog posts about optimization.