Hi, If I've understood your macro function definition it processes one data set only, so maybe you could call your macro 3 times, each time supplying the different data set name. To automatically loop through a space-separated list of data set names then you could use something like the following, based on code supplied by @Tom: %macro infoid_loop(datalist); %local i date ; %do i=1 %to %sysfunc(countw(&datalist,%str( ))); %let dataset=%scan(&datalist,&i,%str( )); %infoid(&dataset,arg2,arg3); %end; %mend infoid_loop; Then invoke it: %infoid_loop(set_a set b set_c,arg2,arg3); One thing I noticed is that your macro function definition allows 3 parameters to be passed to it: %macro infoid(data,xvar,yvar); but you are only calling it with 2 parameters: %infoid(&xvar,gbi); If you are still having problems then please post the log with any error messages showing. Regards, Amir.
... View more