One of useful applications of Choleshk decompostion in a simulation study is to generate random variables with a given covariance structure. In following example, Cholesky decomposition algorithm is writen in IML. The whole logic can be easily implemented a data step. This means that one can easily to generate multivariate random variables with a covariance structure in a date step.
The Cholesky decomposition algorithm can be found at this link,
http://en.wikipedia.org/wiki/Cholesky_decomposition
proc iml;
A = { 0.9858668 0.9832139 0.8740793 0.9125018 0.8980966,
0.9832139 2.0058248 2.0107842 2.0543280 2.0244553,
0.8740793 2.0107842 99.1966824 99.1846182 99.0462248,
0.9125018 2.0543280 99.1846182 100.1625760 100.0319877,
0.8980966 2.0244553 99.0462248 100.0319877 100.8799631
};
U = root(A);
start choldc( A) ;
n=nrow(a);
L=j(n,n,0);
****i=1,j=1****;
L[1,1]=sqrt(A[1,1);
L[2:N,1]=A[2:N,1]/L[1,1];
do i=2 to n;
do j=i to n;
sum=A[i,j];
do k=i-1 to 1 by -1;
sum = sum - L[i,k]*L[j,k];
end;
if i=j then L[i,i]=sqrt(sum);
else L[j,i]=sum/L[i,i];
end;
end;
return(L`) ;
finish;
L=choldc( A) ;
print u L;
quit;