I am still not able to get what I am looking for. I tried this code. %macro hello(X);
use &dataset; read all var{&X} into A;
m=mean(A);
print m;
%mend hello;
proc iml; z=j(5,1,0); do i = 1 to 5; X=randnormal(10,0,1); varNames={X1}; print X[colname=varNames]; create newdata from X[colname=varNames]; append from X; close; %let dataset=newdata; %hello(X1); z[i]=m[1]; end; quit; Following is the error message: NOTE: Module RANDNORMAL loaded from the storage SASHELP.IMLMLIB. NOTE: Module ROWVEC loaded from the storage SASHELP.IMLMLIB. NOTE: Closing WORK.NEWDATA NOTE: The data set WORK.NEWDATA has 10 observations and 1 variables. ERROR: The data set WORK.NEWDATA is in use, cannot be created. statement : CREATE at line 76 column 2 NOTE: Exiting IML.
... View more