I have two matrices in proc iml that I created from two different SAS data sets. Let's call them a and b. I want to create a third matrix (c) by taking the upper-right triangle from matrix a and the lower-left triangle from matrix b. All of the values in the matrices are numeric. I tried using a do loop but was unsuccessful. My matrices are quite large (167x167). Any ideas? This was the code that I tried that did not work: proc iml; use data1; read all into a; use data2; read all into b; c=j(167,167,0); do i=1 to 167; do j=i+1 to 167; end; end; print c; quit;
... View more