Hi, I am having trouble with the sas/iml subroutine module. here is my code:

proc iml;
start corrp(a,b,c,d);
i= {1 2 3 4};
if p=i[1,a] & q=i[1,b] & s=i[1,c] & t=i[1,d] then

A=(y[p,q]-y[p,t]*y[q,t])/sqrt((1-y[p,t]*y[p,t])*(1-y[q,t]*y[q,t]));
B=(y[p,s]-y[p,t]*y[s,t])/sqrt((1-y[p,t]*y[p,t])*(1-y[s,t]*y[s,t]));
C=(y[q,s]-y[q,t]*y[s,t])/sqrt((1-y[q,t]*y[q,t])*(1-y[s,t]*y[s,t]));
rho=(A-B*C)/sqrt((1-B*B)*(1-C*C));

finish;

y={1 0.73456 0.71075 0.70398,0.73456 1.00000 0.69316 0.70855, 0.71075 0.69316 1.00000 0.83925, 0.70398 0.70855 0.83925 1.00000};
a=3;
b=4;
c=1;
d=2;
call corrp(3,4,1,2);
print rho;

my function is corrp(a,b,c,d), and I am trying to call the function with inputvalues a=3;b=4;c=1;d=2; however I keep getting the error message "Matrix has not been set to a value"

Any feedback would be highly appreciated. Thanks in advance!