I am new in sas area, I run below code got error message as below, please help me figure out that, thanks, NOTE: Line generated by the invoked macro "LOOP". 7 select count (distinct presc_ord_npi) as &value1 from bhrx_presc as a where ---------- 22 7 ! gnrc_name like "&value"; quit; ERROR 22-322: Syntax error, expecting one of the following: ',', AS, FROM. code: %macro loop(values); %let count=%sysfunc(countw(&values)); %do i = 1 %to &count; %let value=%qscan(&values,&i,%str(,)); %let value=%sysfunc(dequote(&value)); %put &value; %let value1= %qscan(&value,1); proc sql; select count (distinct presc_ord_npi) as &value1 from bhrx_presc as a where gnrc_name like "&value"; quit; %end; %mend; %loop(%str('METHYLPHENIDATE HCL','DEXTROAMPHETAMINE/AMPHETAMINE,CLONIDINE HCL'));
... View more