Thank you. I corrected some mistakes and updated my code. Note, the macro %RPT was defined previously.
My main issue now is that the macro is getting confused by the commas in the CHILD variable. I tried adding %STR(), as it seemed to help when I ran the %RPT macro by itself, but it doesn't seem to be working within the %RPTOUT loop.
%macro rptout();
%let ctype= %str(4Y, 469Y, 4698, 4699, 4690, 8Y, 869Y, 8698, 8699, 8690);
%let parent= %str(CD4+ T-Cells, CD4+ CD69+ T-Cells, CD4+ CD69+ T-Cells, CD4+ CD69+ T-Cells, CD4+ CD69+ T-Cells, CD8+ T-Cells, CD8+ CD69+ T-Cells, CD8+ CD69+ T-Cells, CD8+ CD69+ T-Cells, CD8+ CD69+ T-Cells);
%let child= %str(%str(IFN-^{unicode gamma}, IL-2, and TNF-^{unicode alpha})*%str(IFN-^{unicode gamma}, IL-2, and TNF-^{unicode alpha})*IFN-^{unicode gamma}*IL-2*TNF-^{unicode alpha});
%let file= %str(cd4_poly, cd4_cd69_poly, cd4_cd69_IFNg, cd4_cd69_IL2, cd4_cd69_TNFa, cd8_poly, cd8_cd69_poly, cd8_cd69_IFNg, cd8_cd69_IL2, cd8_cd69_TNFa);
%do A= 1 %to %sysfunc(CountW(&CTYPE));
%do B= 1 %to %sysfunc(CountW(&CHILD, '*'));
%let W= %scan(&CTYPE, &A, ',');
%let X= %scan(&PARENT, &A, ',');
%let Y= %scan(&CHILD, &B, '*');
%let Z= %scan(&FILE, &A, ',');
%rpt(ctype= &W, /*Target Cell Type*/
parent= &X, /*Parent Gate*/
child= %str(&Y), /*Child Gate*/
filename= &Z /*File Name*/
);
%end;
%end;
%mend rptout;
%rptout;
... View more