Hell everyone, I am trying to create a macro to get different datasets created by the make variable /* Obtain distinct make list */ proc sql noprint; select distinct make into :make_list separated by ',' from sashelp.cars; quit; /* Count the number of distinct makes */ %let make_count = %sysfunc(countw(&make_list)); /* Loop through each distinct make */ %do i = 1 %to &make_count ; %let make = %scan(&make_list, &i, ,); data &make.; set sashelp.cars; where make="&make."; run; %end; giving me error: ERROR: The function COUNTW referenced by the %SYSFUNC or %QSYSFUNC macro function has too many arguments.
... View more