You didn't give the error message, so I don't know which of the errors you might be referring to. I see a few:
(1) SAS/IML indexes vectors from 1, so the expression optn=j(0,11,.) is incorrect.
(2) IML uses local variables in modules, so the variables estvar,col1,col2,col3, etc, are undefined within the modules. Maybe you intended to use a GLOBAL clause?