I agree with andreas_Ids solution your two macro sub-routines do not appear to have the same parameters I am not a user of proc req so I will not guess that your parameter named 'predict' is a variable name if parameter 'predict' is a variable name then consider this %macro choose_verb(data = sashelp.class ,list_names = a b c d e f h); %let n_items = %sysfunc(countw(&list_names)); %put echo &=n_items; %do i = 1 %to &n_items; %let item = %scan(&list_names,&i); %put echo &=item; %*automagic: get type of variable; %*let dsid = %sysfunc(open()); %*let var_num = %sysfunc(varnum()); %*let type = %sysfunc(vartype()); %*let rc = %sysfunc(close()); %let type = c;%*<---<<<; %if &type eq c %then %put do_freq(data= &data,name = &item); %else %put do_reg(data= &data,name = &item); %end; %mend; %choose_verb(data = work.all_del ,list_names = age sex height weight)
... View more