May want to try: %let param=%upcase(¶m); data labtabs; merge data1 data2; by pt; if upcase(LPARM) = "¶m"; *********FLUFF****** run; Also, within macro everything is text, so you generally don't need and don't want to use quotes, which will lose their special meaning once they are pushed to the macro processor. Also, not necessary to initialize i. %macro CreateLabTab(paramlist,headerlist); %put &=paramlist; %put &=headerlist; /*%let i=1;*/ %do i = 1 %to %sysfunc(countw(¶mlist)); %let param=%scan(¶mlist., &i,%bquote( )); %let header=%scan(&headerlist., &i,%bquote(,)); %put &=i &=param &=header; %end; %mend; %let paramlist = ALK_PHOS_SER AST_SGOT_SER; %let headerlist=Alkaline phosphatase (U/L),ALT (mg/dL); %CreateLabTab(¶mlist,%bquote(&headerlist));
... View more