Dear Rick Wicklin Sir,
Right now I am working on my Bachelor's thesis and encounter some problems with using IML.

I'm working on financial data, and trying to develop universe return and cumulative return of benchmark using IML/Macro.

%let month = 5;
%let startmonth = 5;
%let endmonth = 5;
%let startyear = 1999;
%let endyear = 1999;
%let numyears = %eval(&endyear-&startyear+1);
%let nummonths = %eval(&endmonth-&startmonth+1);

%macro byyear;
%do k = &startyear %to &endyear %by 1;
data t&k;
set toydata;
where year=&k and month=&month;
run;
/*calculation*/
ods output avg_return&k = Areturn&k;
proc iml;
/* Set up array for the Chloe Matrix using &numyears for an array factor */
/* The allocaiton for j is nummonths, and the allocaiton for i is numyears*/
/* i is number of rown = years, and j is the portfolio, i.e., month */
use t&k;
read all into a;
return&k = a[,2];
weight&k = 1/ nRow(return&k);

nonMissing = loc(return&k ^=.);
if ncol(nonMissing)=0 then mean = .;
else do;
return&k= return&k[nonMissing,];
avg_return&k= sum(return&k*weight&k);
end;
/* chloe(i,j) = avg_return&k */
print avg_return&k;
quit;
%end;
%mend byyear;
%byyear;

I am able to get the value, 'avg_return&k.'After getting the avg_return&k, I want to put this value into another vector/array, to make it look like

Jan Feb
1999 1.277 0.22
2000 0.988 ...

something looks like this. Would you be able to give me some recommendation?

Your book helped me a lot for my research. Thank you very much.
Sincerely, Chloe