Let's say I'm trying to do the following:
%macro test(a=);
%do i=1 %to &a;
proc iml;
b=b//(2*i);
quit;
%end;
proc iml;
print sum(b);
quit;
%mend;
%test(a=2);
In the code I'm trying to write, I can't put it all in one IML (I need a proc freq within the do loop). The code above gives the error "Matrix b not set to a value." How do I tell SAS what b is so that I can still access it after I've quit the iml statement?