/* sorry for my mistakes it works more easy with a data step but still understand why my macro program doesn't work , it seems the it is indefinitely runing .....*/ /* i have en error when i submit my code with my example where source and string contains quotation marks or special caracters i have created the source and string macro variable with proc sql statment using into: separated by ' ' ( space ) */ %macro control_find_word(source,string,dlm); %let k=1; %let ID_dim=%scan(&string. , &k ," "); %do %while (&ID_dim ne ); data _null_; result = indexw("&source","&string"," "); call symputx('result',result,'g'); run; %if &result=0 %then %do; %let control_dim=1; %put ERROR: WORD DOES NOT EXIST; %goto fin; %end; %let k=%eval(&k+1); %let ID_dim=%scan(&string. , &k ," "); %end; %FIN : ; %mend; %control_find_word(&source,&string,);
... View more