05-06-2014 05:30 AM
Since you have asked several elementary questions, here is a link to an article that might help: How to learn SAS/IML: Five resources for the beginner - The DO Loop
In particular, tip #4 is relevant. When you write your funtion, you will need to use the
DET function, and
BTW, your logic is backwards: if the determinant is NOT zero, you can compute the inverse.