In reply to James Moody.

1) Your code does not define a macro variable named 'j'
2) Read the article "Macros and loops in the SAS/IML language"
3) Post programming questions to one of the SAS Support Communities.