In reply to Tim.

The comment field in a blog is not a good medium for discussing programs. Please post your question to the SAS/IML Support Community. Please include sample observations for the two data sets that you mention.