In reply to Tanya.

The best way to get programming advice is to post questions to the SAS/IML Discussion Forum at http://communities.sas.com/community/sas_iml_and_sas_iml_studio
Someone there will help.

There are many mistakes in this program. I can't give specific advise to everyone who writes, but try:
c=d || rm;
c = c[,2:27]-c[,1:26];
x=n||d||c;
free c;