Rick-
Suppose now that I had a matrix instead of a vector, let say A={1 2; 3 4} and B={1 . 3; . 1 2}. Can I still use the loc function to find the indices of the missing values for the B matrix?
So I would need to get B1={1 3;1 2}, then do A*B1 and then augment the B1 matrix with corresponding missing values.
Here is what I thought of. I assume there is a faster way?
proc iml;
a={1 2,3 4};
b={1 . 3,. 1 2};
nm=loc(b^=.);
b1=shape(b[loc(b^=.)],nrow(a),ncol(a));
y=shape(a*b1,ncol(nm));
y1=repeat(.,nrow(b)*ncol(b));
y1[nm]=y;
y1=shape(y1,nrow(b),ncol(b));
print a,b,nm,b1,y,y1;
quit;
Message was edited by: trekvana