In reply to KAREN SHORE.

Here are two suggestions:
1. Post code and ask questions at the SAS Support Communities. There are communities for many areas of SAS, including SAS/IML.
2. Get rid of the macro loops in PROC IML. They are not needed. Use a program like this:

/* Step 1: Read in the data */
varnames={'x1' 'c1' 'b1'};
do k=1 to &num_samples;
dsIn = 'dat' + strip(char(k));
use (dsIn); read all var varnames into x; close;

/* do the computations here */

newvarnames={'new_y' 'new_x1' 'new_c1' 'new_b1'};
dsOut = 'Out' + strip(char(k));
create (dsOut) from w[c=newvarnames];
append from w;
close;
end;

In general, it is better to deal with one large data set that has many samples instead of many data sets that each have one sample. See "Simulation in SAS: The slow way or the BY way."