I respond to your point in;
https://communities.sas.com/t5/SAS-Programming/SAS-Loop-over-dataset-for-create-export-files/m-p/591...
Yes, you can use call execute. Call execute creates a string, which is inserted into the code after the executing block. If that string is valid SAS code then it will run, otherwise you will get errors and warnings per any other SAS code. From your screenshot
it is clear that there are spaces missing in the generated code which are causing the issues, this is due to the cats() function call. Alter the code to:
proc sort data=have out=list nodupkey;
by type;
run;
data _null_;
set have;
call execute(cats('proc export data=have outfile="c:\',type,'.xlsx"; where type="',type,'"; run;'));
run;
Where have is your input data. This will create one proc export command for each unique type string.