HI SPR,
thanks for your answer. However, I think I didn't make my question clear enqough. Sorry for that! I'm searching in a variable for a list of expressions (the list is a macro variable that contains expressions which are delimited by a "*" and each word is searched with the help of a loop), and some of these expressions contain closed or open brackets as well as commas (e.g., "have, in the past,"). When I search for these expressions in a macro (text is the variable I am searching) with
count_word=count(text,&expressions);
then SAS gives back an error: "More positional parameters found than defined."
Here is my complete code:
%macro count_exp_gen(list);
%let count=1;
%let delim=*;
%let express=%scan(&list,&count,&delim);
%do %while (%length(&express) ne 0);
count_gen_&count = countc(text,"&express",'w') ;
%let count=%eval(&count + 1);
%let express=%scan(&list,&count,&delim);
%end;
%mend;
The macro variable is given by:
GLOBAL GENERALS
INTHEFUTURE*FORSPECULAT*FORTRAD*HOWANDWHY*SPECULATIVETRAD*ACCOUNTFOR*MAY*HEDGINGOFOURCOMMONSTOCK*APPRO
PRIATE*WOULDREQUIREDISCLOSURE*
Hope this helps to understand my question.
Thanks,
Valentin
... View more