In reply to MZ.

Thanks for writing. My comment was about the FIRST error in his program. You are correct to point out that the log shows a second error near the end of the program.

The RETURN function has supported optional parentheses since SAS/IML 13.1, which was released in 2013 as part of SAS 9.4M1. If you are using an older version of SAS, you need to use parentheses around the argument. I will update the post so that no one else is confused.